apis

Get API namespace

Changed on

Retrieve basic information about an API namespace including its ID and name.

Use this to verify an API exists before performing operations, get the human-readable name when you only have the API ID, or confirm access to a specific namespace. For detailed key information, use the listKeys endpoint instead.

Required Permissions

Your root key must have one of the following permissions:

  • api.*.read_api (to read any API)
  • api.<api_id>.read_api (to read a specific API)
post/v2/apis.getApi

Request

  • Base URL
    https://api.unkey.com
  • URL
    https://api.unkey.com/v2/apis.getApi
  • Auth
    HTTP bearer

Request body

apiIdstring required

Specifies which API to retrieve by its unique identifier. Must be a valid API ID that begins with 'api_' and exists within your workspace.

Example request

{
  "apiId": "api_1234abcd"
}

Response

API information retrieved successfully. Contains the unique API ID and human-readable name.

Example response

{
  "meta": {
    "requestId": "req_123"
  },
  "data": {
    "id": "api_1234567890abcdef",
    "name": "payment-service-production"
  }
}

Changes

    • breaking

      the / response property's maxLength was increased from 255 to 256 for the response status

    • info

      the endpoint scheme security bearer was added to the API

    • info

      the endpoint scheme security rootKey was removed from the API