> ## Documentation Index
> Fetch the complete documentation index at: https://docs.near.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Revoke the credential you hold

> Revokes the credential sent in the `Authorization` header, so a holder whose credential leaked can end it with the credential alone. An API key is deleted; a session token or refresh token ends that session and the user's other sessions stay. The request takes no body and cannot revoke any other credential. Repeating the request with the revoked credential is refused with 401.



## OpenAPI

````yaml /api-reference/cloud-platform-openapi.json post /v1/auth/revoke
openapi: 3.1.0
info:
  description: Account, organization, workspace and billing routes of NEAR AI Cloud.
  title: NEAR AI Cloud Platform API
  version: '5'
servers:
  - url: https://cloud-platform.near.ai
    description: NEAR AI Cloud Platform
security: []
paths:
  /v1/auth/revoke:
    post:
      tags:
        - Authentication
      summary: Revoke the credential you hold
      description: >-
        Revokes the credential sent in the `Authorization` header, so a holder
        whose credential leaked can end it with the credential alone. An API key
        is deleted; a session token or refresh token ends that session and the
        user's other sessions stay. The request takes no body and cannot revoke
        any other credential. Repeating the request with the revoked credential
        is refused with 401.
      operationId: revoke_credential
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Revoked'
          description: The credential was revoked.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
          description: The credential is missing, invalid or already revoked.
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
          description: Internal error.
      security:
        - api_key: []
        - session: []
        - reporting_token: []
        - refresh_token: []
components:
  schemas:
    Revoked:
      description: The credential that was revoked.
      properties:
        id:
          description: The id of the revoked credential.
          format: uuid
          type: string
        revoked:
          description: >-
            The kind of credential that was revoked, such as `api_key`,
            `session` or `reporting_token`.
          type: string
      required:
        - revoked
        - id
      type: object
    ErrorBody:
      description: The error body of the routes that take any credential.
      properties:
        code:
          description: A short error code, such as `caller_unauthorized`.
          type: string
        message:
          type: string
      required:
        - code
        - message
      type: object
  securitySchemes:
    api_key:
      bearerFormat: sk-
      description: 'API key beginning with `sk-`, sent as `Authorization: Bearer <key>`.'
      scheme: bearer
      type: http
    session:
      bearerFormat: Session token
      description: 'Session token from signing in, sent as `Authorization: Bearer <token>`.'
      scheme: bearer
      type: http
    reporting_token:
      bearerFormat: rpt-
      description: >-
        Reporting token beginning with `rpt-`, sent as `Authorization: Bearer
        <token>`.
      scheme: bearer
      type: http
    refresh_token:
      bearerFormat: rt_
      description: >-
        Refresh token beginning with `rt_`, sent as `Authorization: Bearer
        <token>`.
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.