const { result, error } = await unkey.apis.get({
  apiId: "api_123",
});

if (error) {
  // handle potential network or bad request error
  // a link to our docs will be in the `error.docs` field
  console.error(error.message);
  return;
}

console.log(result);
{
  "result": {
    "id": 'api_123',
    "name": 'My API',
    "workspaceId": 'ws_123'
  }
}
const { result, error } = await unkey.apis.get({
  apiId: "api_123",
});

if (error) {
  // handle potential network or bad request error
  // a link to our docs will be in the `error.docs` field
  console.error(error.message);
  return;
}

console.log(result);
{
  "result": {
    "id": 'api_123',
    "name": 'My API',
    "workspaceId": 'ws_123'
  }
}

Request

apiId
string
required

The id of the api to retrieve.

Response

result