API keys

Create an API key

Changed on

Creates a new API key.

post/api_key

Request

  • Base URL
    https://api.nullplatform.com
  • URL
    https://api.nullplatform.com/api_key
  • Auth
    HTTP bearer

Request body

namestring required

A descriptive name for the API key.

Example request

{
  "name": "my-machine-process-that-will-access-nullplatform",
  "grants": [
    {
      "nrn": "organization=1:account=1:namespace=1:application=4",
      "role_slug": "machine:ci"
    }
  ],
  "tags": [
    {
      "key": "CI",
      "value": "main"
    }
  ]
}

Response

The operation was successful.

idinteger required

Unique ID for the API key.

namestring required

The descriptive name given to the API key.

api_keystring required

Your newly created API key.

⚠️ Save your API key securely.

The API key value will be displayed only once. Make sure to store it in a secure location as it cannot be retrieved later.

masked_api_keystring nullable

Your masked API key.

owner_idinteger

The unique ID of the user that creates the API key.

last_used_atstring date-time nullable

The ISO-8601 UTC timestamp of when the API key was last used.

created_atstring date-time required

The ISO-8601 UTC timestamp of when the API key was created.

updated_atstring date-time required

The ISO-8601 UTC timestamp of when the API key was last updated.

Example response

{
  "id": 1234,
  "name": "CI/CD Main",
  "api_key": "AAAA.1234567890abcdef1234567890abcdefPTs=",
  "masked_api_key": "AAAA.xxxxxxxxxxxxxxxxxxxxxPTs=",
  "tags": [
    {
      "key": "CI",
      "value": "main"
    }
  ],
  "grants": [
    {
      "nrn": "organization=1:account=1:namespace=1:application=4",
      "role_id": 1855672260,
      "role_slug": "machine:ci",
      "actions": [
        "application:read",
        "deployment:create"
      ],
      "inherits": [
        {
          "id": 1855672260,
          "slug": "ops",
          "organization_id": 1
        }
      ],
      "added": [
        "application:delete"
      ],
      "removed": [
        "deployment:create"
      ]
    }
  ],
  "owner_id": 1595,
  "last_used_at": "2021-01-02T00:00:00Z",
  "created_at": "2021-01-02T00:00:00Z",
  "updated_at": "2021-01-02T00:00:00Z"
}

Changes

    • breaking

      the response property became optional for the status

    • breaking

      the response property became optional for the status

    • breaking

      removed the required property from the response with the status

    • breaking

      removed the required property from the response with the status

    • breaking

      removed the required property from the response with the status

    • breaking

      removed the required property from the response with the status

    • info

      media type application/json was changed to a more specific media type application/problem+json for the response status

    • info

      media type application/json was changed to a more specific media type application/problem+json for the response status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      response property message deprecated

    • info

      response property message deprecated

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added to the / request property oneOf list

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status

    • info

      added the optional property // to the response with the status