Skip to content

Get an API key

GET
/v2/api-keys/{id}
curl --request GET \
--url https://api.connect.ms/v2/api-keys/example \
--header 'Authorization: Bearer <token>'

Returns one key’s settings and usage. The key itself is never returned here.

id
required
string

The id of the key.

Connect-Version
string

The API version to use, for example 2026-10-01. Defaults to the version set on your API key.

The key.

Media typeapplication/json

An API key of the workspace.

object
id
required

The unique id of the key.

string
name

The display name of the key, or null.

string
nullable
keyPrefix
required

The first six characters of the key, for telling keys apart.

string
keyLast4
required

The last four characters of the key.

string
limits
required
One of:

The key’s SMS send limits and how much of them has been used.

object
dailyParts

The most SMS parts the key may send per UTC day. Null means unlimited.

integer format: int32
nullable
monthlyParts

The most SMS parts the key may send per UTC calendar month. Null means unlimited.

integer format: int32
nullable
usedToday
required

SMS parts counted against the key so far today (UTC), including parts reserved for sends being processed.

integer format: int32
usedThisMonth
required

SMS parts counted against the key so far this calendar month (UTC), including parts reserved for sends being processed.

integer format: int32
strictMode
required

True when every v2 request with this key must be signed and every POST or PATCH must carry an Idempotency-Key.

boolean
signing
One of:

How requests with the key are signed.

object
algorithm
required
One of:

The algorithm requests are signed with: hmac_sha256 (a shared secret issued by Connect) or ecdsa_p256_sha256 (your own P-256 key pair; you supply the public key).

string
Allowed values: hmac_sha256 ecdsa_p256_sha256
publicKey

The P-256 public key in SubjectPublicKeyInfo PEM format. Null for hmac_sha256.

string
nullable
apiVersion

The Connect-Version the key is pinned to. Null means it follows the current version.

string
nullable
createdAt
required

When (UTC) the key was created.

string format: date-time
activeFrom
required

When (UTC) the key becomes usable.

string format: date-time
expiresAt

When (UTC) the key stops working, or null when it does not expire. Set on a key that has been rotated.

string format: date-time
nullable
lastUsedAt

When (UTC) the key was last used. Not yet tracked, so always null.

string format: date-time
nullable
key

The full key. Only returned by the response that issued it (create and rotate); null everywhere else.

string
nullable
signingSecret

The hmac_sha256 signing secret. Only returned by create, rotate (which carries the existing secret over), rotate-signing-secret, or an update that switched the key to hmac_sha256; null everywhere else.

string
nullable

Example

{
"signing": {
"algorithm": "hmac_sha256"
}
}

The request is not valid. The detail field says why, and errors lists any problems by field name.

Media typeapplication/problem+json

Why a request failed, in the RFC 9457 problem details format.

object
type
required

A URI identifying the kind of problem, ending in a code such as validation_failed, not_found, sending_blocked or rate_limited.

string
title
required

A short, fixed summary of the kind of problem.

string
status
required

The HTTP status code of the response.

integer format: int32
detail

What went wrong with this particular request, when there is more to say than the title.

string
nullable
errors

For validation failures, the problems found, keyed by field name (nested fields as template.name, list items as messages[3]).

object
key
additional properties
Array<string>
requestId
required

The id recorded for this error, matching the Request-Id header when one is sent. Quote it when contacting support.

string

Example generated

{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"errors": {
"additionalProperty": [
"example"
]
},
"requestId": "example"
}

The API key or bearer token is missing or not valid, or the request signature could not be verified.

Media typeapplication/problem+json

Why a request failed, in the RFC 9457 problem details format.

object
type
required

A URI identifying the kind of problem, ending in a code such as validation_failed, not_found, sending_blocked or rate_limited.

string
title
required

A short, fixed summary of the kind of problem.

string
status
required

The HTTP status code of the response.

integer format: int32
detail

What went wrong with this particular request, when there is more to say than the title.

string
nullable
errors

For validation failures, the problems found, keyed by field name (nested fields as template.name, list items as messages[3]).

object
key
additional properties
Array<string>
requestId
required

The id recorded for this error, matching the Request-Id header when one is sent. Quote it when contacting support.

string

Example generated

{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"errors": {
"additionalProperty": [
"example"
]
},
"requestId": "example"
}

The caller is not allowed to do this.

Media typeapplication/problem+json

Why a request failed, in the RFC 9457 problem details format.

object
type
required

A URI identifying the kind of problem, ending in a code such as validation_failed, not_found, sending_blocked or rate_limited.

string
title
required

A short, fixed summary of the kind of problem.

string
status
required

The HTTP status code of the response.

integer format: int32
detail

What went wrong with this particular request, when there is more to say than the title.

string
nullable
errors

For validation failures, the problems found, keyed by field name (nested fields as template.name, list items as messages[3]).

object
key
additional properties
Array<string>
requestId
required

The id recorded for this error, matching the Request-Id header when one is sent. Quote it when contacting support.

string

Example generated

{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"errors": {
"additionalProperty": [
"example"
]
},
"requestId": "example"
}

No API key with that id in this workspace.

Media typeapplication/problem+json

Why a request failed, in the RFC 9457 problem details format.

object
type
required

A URI identifying the kind of problem, ending in a code such as validation_failed, not_found, sending_blocked or rate_limited.

string
title
required

A short, fixed summary of the kind of problem.

string
status
required

The HTTP status code of the response.

integer format: int32
detail

What went wrong with this particular request, when there is more to say than the title.

string
nullable
errors

For validation failures, the problems found, keyed by field name (nested fields as template.name, list items as messages[3]).

object
key
additional properties
Array<string>
requestId
required

The id recorded for this error, matching the Request-Id header when one is sent. Quote it when contacting support.

string

Example generated

{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"errors": {
"additionalProperty": [
"example"
]
},
"requestId": "example"
}

The service is temporarily unavailable. Retry after the Retry-After header.

Media typeapplication/problem+json

Why a request failed, in the RFC 9457 problem details format.

object
type
required

A URI identifying the kind of problem, ending in a code such as validation_failed, not_found, sending_blocked or rate_limited.

string
title
required

A short, fixed summary of the kind of problem.

string
status
required

The HTTP status code of the response.

integer format: int32
detail

What went wrong with this particular request, when there is more to say than the title.

string
nullable
errors

For validation failures, the problems found, keyed by field name (nested fields as template.name, list items as messages[3]).

object
key
additional properties
Array<string>
requestId
required

The id recorded for this error, matching the Request-Id header when one is sent. Quote it when contacting support.

string

Example generated

{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"errors": {
"additionalProperty": [
"example"
]
},
"requestId": "example"
}