const url = 'https://api.defined.net/v2/whoami';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.defined.net/v2/whoami \ --header 'Authorization: Bearer <token>'Identify the API key making the request and the organization it belongs to. Requires no particular scope.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”Successful operation
object
object
Always apiKey when the request is authenticated with an API key.
object
Always an empty string. API keys don’t record who created them.
object
The organization’s plan. Known values are free and pro. New values may be added, so clients should accept values not listed here.
Example
{ "data": { "actorType": "apiKey", "actor": { "id": "dnkey-DXALSPQONG7H45QZAVTPRDMAPU", "organizationID": "org-F63A24JGCLJV3ZEUTLCBISGETA", "createdByUserID": "", "name": "Terraform", "createdAt": "2025-01-25T18:15:27Z" }, "organization": { "id": "org-F63A24JGCLJV3ZEUTLCBISGETA", "name": "Example Corp", "plan": "pro", "createdAt": "2023-02-14T20:34:59Z" } }}The API key is missing, invalid or expired.
object
object
A static name for the error type
A short human readable description of the error
Describes the variable missing or malformed
The query parameter the error relates to, such as filter.targetType
Machine-readable details about the error. ERR_LIMIT_EXCEEDED errors carry limit and limitName.
object
The maximum number of resources allowed
The kind of resource the limit applies to
Example
{ "errors": [ { "code": "ERR_UNAUTHORIZED", "message": "unauthorized" } ]}The organization has exceeded its API request rate limit. Retry the request after a short delay.
object
object
A static name for the error type
A short human readable description of the error
Describes the variable missing or malformed
The query parameter the error relates to, such as filter.targetType
Machine-readable details about the error. ERR_LIMIT_EXCEEDED errors carry limit and limitName.
object
The maximum number of resources allowed
The kind of resource the limit applies to
Example
{ "errors": [ { "code": "ERR_TOO_MANY_REQUESTS", "message": "too many requests" } ]}