Skip to main content
GET
/
api-key-pairs
/
{api_key_pair_id}
C#
using Gr4vy;
using Gr4vy.Models.Components;

var sdk = new Gr4vySDK(
    id: "example",
    server: SDKConfig.Server.Sandbox,
    bearerAuthSource: Auth.WithToken(privateKey),
    merchantAccountId: "default"
);

var res = await sdk.ApiKeyPairs.GetAsync(apiKeyPairId: "fe26475d-ec3e-4884-9553-f7356683f7f9");

// handle response
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "thumbprint": "<string>",
  "display_name": "<string>",
  "active": true,
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "type": "api-key-pair",
  "private_key": "<string>",
  "creator": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "name": "<string>",
    "email_address": "john.doe@example.com",
    "thumbprint": "6zsbrjs0Cp4M4Ebz8sfHqUKGiG9Sd0lF2sfKp5-w-nk"
  },
  "merchant_accounts": [
    {
      "id": "<string>",
      "display_name": "<string>",
      "created_at": "2023-11-07T05:31:56Z",
      "updated_at": "2023-11-07T05:31:56Z",
      "type": "merchant-account",
      "over_capture_amount": 123,
      "over_capture_percentage": 123
    }
  ],
  "roles": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "name": "<string>",
      "description": "<string>",
      "permissions": {
        "allow": [
          "<string>"
        ]
      },
      "type": "role"
    }
  ]
}
This endpoint requires the api-key-pairs.read scope.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

api_key_pair_id
string<uuid>
required

The ID of the API key pair.

Example:

"fe26475d-ec3e-4884-9553-f7356683f7f9"

Response

Successful Response

id
string<uuid>
required

The ID for the API key pair.

Example:

"fe26475d-ec3e-4884-9553-f7356683f7f9"

thumbprint
string
required

The unique thumbprint that identifies the API key pair.

Example:

"6zsbrjs0Cp4M4Ebz8sfHqUKGiG9Sd0lF2sfKp5-w-nk"

display_name
string
required

The display name for the API key pair.

Required string length: 1 - 200
Example:

"Production key"

algorithm
enum<string>
required

The algorithm used to generate the API key pair.

Available options:
ECDSA,
RSA
Example:

"ECDSA"

active
boolean
required

Whether the API key pair is active and can be used to authenticate.

Example:

true

created_at
string<date-time>
required

The date and time when this API key pair was created.

Example:

"2013-07-16T19:23:00.000+00:00"

updated_at
string<date-time>
required

The date and time when this API key pair was last updated.

Example:

"2013-07-16T19:23:00.000+00:00"

type
string
default:api-key-pair

The type of this resource.

Allowed value: "api-key-pair"
private_key
string | null

The PEM-encoded private key. Only returned once, in the response to creating the API key pair, and only when Gr4vy generated the key pair. Store it securely, as it cannot be retrieved later.

creator
Creator · object | null

The user or API key pair that created this API key pair.

merchant_accounts
MerchantAccountSummary · object[]

The merchant accounts this API key pair has access to. An empty list means it has access to all merchant accounts.

roles
Role · object[]

The roles assigned to this API key pair.