Secret Management API

The Nexmo Secret Management API enables you to create one new API Secret in addition to your existing API Secret. Once you've validated that your new API secret works you can revoke your old API secret using this API

Download OpenAPI 3 Definition

Retrieve API Secrets

GET https://api.nexmo.com /accounts/:api_key/secrets

Authentication

  • Key
    Description
    Example
    Default
  • Authorization
    Base64 encoded API key and secret joined by a colon.
    Read more
    Basic <base64>
    None

Path Parameters

  • Key
    Description
    Example
    Default
  • api_key
    Required | string

    The API key to manage secrets for

    abcd1234
    None

View response field descriptions


200 HTTP response

{
  "_links": {
    "self": {
      "href": "/accounts/abcd1234/secrets"
    }
  },
  "_embedded": {
    "secrets": [
      {
        "_links": {
          "self": {
            "href": "/accounts/abcd1234/secrets/ad6dc56f-07b5-46e1-a527-85530e625800"
          }
        },
        "id": "ad6dc56f-07b5-46e1-a527-85530e625800",
        "created_at": "2017-03-02T16:34:49Z"
      }
    ]
  }
}

401 HTTP response

404 HTTP response

Create API Secret

POST https://api.nexmo.com /accounts/:api_key/secrets

Authentication

  • Key
    Description
    Example
    Default
  • Authorization
    Base64 encoded API key and secret joined by a colon.
    Read more
    Basic <base64>
    None

Path Parameters

  • Key
    Description
    Example
    Default
  • api_key
    Required | string

    The API key to manage secrets for

    abcd1234
    None

Request body application/json

  • Key
    Description
    Example
    Default
  • secret
    Required | string

    The new secret must follow these rules:

    • minimum 8 characters
    • maximum 25 characters
    • minimum 1 lower case character
    • minimum 1 upper case character
    • minimum 1 digit
    example-4PI-secret
    None

View response field descriptions


201 HTTP response

{
  "_links": {
    "self": {
      "href": "/accounts/abcd1234/secrets/ad6dc56f-07b5-46e1-a527-85530e625800"
    }
  },
  "id": "ad6dc56f-07b5-46e1-a527-85530e625800",
  "created_at": "2017-03-02T16:34:49Z"
}

400 HTTP response

401 HTTP response

403 HTTP response

404 HTTP response

Retrieve API Secret

GET https://api.nexmo.com /accounts/:api_key/secrets/:secret_id

Authentication

  • Key
    Description
    Example
    Default
  • Authorization
    Base64 encoded API key and secret joined by a colon.
    Read more
    Basic <base64>
    None

Path Parameters

  • Key
    Description
    Example
    Default
  • api_key
    Required | string

    The API key to manage secrets for

    abcd1234
    None
  • secret_id
    Required | string

    ID of the API Secret

    ad6dc56f-07b5-46e1-a527-85530e625800
    None

View response field descriptions


200 HTTP response

{
  "_links": {
    "self": {
      "href": "/accounts/abcd1234/secrets/ad6dc56f-07b5-46e1-a527-85530e625800"
    }
  },
  "id": "ad6dc56f-07b5-46e1-a527-85530e625800",
  "created_at": "2017-03-02T16:34:49Z"
}

401 HTTP response

404 HTTP response

Revoke API Secret

DELETE https://api.nexmo.com /accounts/:api_key/secrets/:secret_id

Authentication

  • Key
    Description
    Example
    Default
  • Authorization
    Base64 encoded API key and secret joined by a colon.
    Read more
    Basic <base64>
    None

Path Parameters

  • Key
    Description
    Example
    Default
  • api_key
    Required | string

    The API key to manage secrets for

    abcd1234
    None
  • secret_id
    Required | string

    ID of the API Secret

    ad6dc56f-07b5-46e1-a527-85530e625800
    None

204 HTTP response

No content

401 HTTP response

403 HTTP response