Skip to content

Get the key's owner

GET
/me
curl --request GET \
--url https://api.cedr.dev/v1/me \
--header 'Authorization: Bearer <token>'

Returns the person who owns the API key, the key’s name and every organization they belong to with their role in it. Use it to check that a key works before you rely on it.

The key is valid.

Media typeapplication/json
object
user
required
object
id
required

The person’s ID.

string
name
required

Their display name.

string
email
required

The address they sign in with.

string format: email
key
required
object
name
required

The name given to the key when it was created.

string | null
organizations
required

Every organization the person belongs to.

Array<object>
object
id
required
string
name
required
string
role
required
string
Allowed values: owner admin member

Example

{
"user": {
"id": "q7Rz2Lw9Xk4mT1cB",
"name": "Sam Rivera",
"email": "sam@northwind.example"
},
"key": {
"name": "ci-deploy"
},
"organizations": [
{
"id": "Hn5bV8yP3dJ6sA0e",
"name": "Northwind Labs",
"role": "owner"
}
]
}

The key is missing (missing_api_key) or invalid, expired or revoked (invalid_api_key). The WWW-Authenticate header names the Bearer scheme.

Media typeapplication/json
object
error
required

A stable code to branch on.

string
Allowed values: missing_api_key invalid_api_key ip_not_allowed insufficient_scope rate_limited not_found internal_error
message
required

A readable explanation. Its wording may change.

string

Example

{
"error": "invalid_api_key",
"message": "The key is invalid, expired or revoked."
}
WWW-Authenticate
string
Example
Bearer realm="cedr.dev"

The key works but may not make this request: it was used from an address outside its IP allowlist (ip_not_allowed), or it is read-only and the request is not a GET or HEAD (insufficient_scope).

Media typeapplication/json
object
error
required

A stable code to branch on.

string
Allowed values: missing_api_key invalid_api_key ip_not_allowed insufficient_scope rate_limited not_found internal_error
message
required

A readable explanation. Its wording may change.

string

Example

{
"error": "ip_not_allowed",
"message": "This key can't be used from this IP address."
}

The key sent more requests in a minute than its owner’s plan allows (rate_limited): 30 on Free, 120 on Pro, 300 on Team and 600 on Business.

Media typeapplication/json
object
error
required

A stable code to branch on.

string
Allowed values: missing_api_key invalid_api_key ip_not_allowed insufficient_scope rate_limited not_found internal_error
message
required

A readable explanation. Its wording may change.

string

Example

{
"error": "rate_limited",
"message": "This key is over its plan's requests-a-minute limit."
}
Retry-After
integer

Seconds to wait before retrying.

Example
60

Something failed on our side (internal_error). Retry with backoff.

Media typeapplication/json
object
error
required

A stable code to branch on.

string
Allowed values: missing_api_key invalid_api_key ip_not_allowed insufficient_scope rate_limited not_found internal_error
message
required

A readable explanation. Its wording may change.

string

Example

{
"error": "internal_error",
"message": "Something went wrong on our side. Try again."
}