GXS Internal
Identity serverAPI reference

Api-key

/api-key/create

POST
/api-key/create

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Request Body

application/json
  1. body
configId?string

The configuration ID to use for the API key. If not provided, the default configuration will be used.

name?string

Name of the Api Key

expiresIn?|

Expiration time of the Api Key in seconds

prefix?string

Prefix of the Api Key

remaining?|

Remaining number of requests. Server side only

metadata?unknown
refillAmount?number

Amount to refill the remaining count of the Api Key. server-only. Eg: 100

refillInterval?number

Interval to refill the Api Key in milliseconds. server-only. Eg: 1000

rateLimitTimeWindow?number

The duration in milliseconds where each request is counted. Once the maxRequests is reached, the request will be rejected until the timeWindow has passed, at which point the timeWindow will be reset. server-only. Eg: 1000

rateLimitMax?number

Maximum amount of requests allowed within a window. Once the maxRequests is reached, the request will be rejected until the timeWindow has passed, at which point the timeWindow will be reset. server-only. Eg: 100

rateLimitEnabled?boolean

Whether the key has rate limiting enabled. server-only. Eg: true

permissions?

Permissions of the Api Key.

userId?string

User Id of the user that the Api Key belongs to. server-only. Eg: "user-id"

organizationId?string

Organization Id of the organization that the Api Key belongs to. Eg: 'org-id'

Response Body

API key created successfully

application/json
  1. response
id*string

Unique identifier of the API key

createdAt*string

Creation timestamp

Formatdate-time
updatedAt*string

Last update timestamp

Formatdate-time
name?string

Name of the API key

prefix?string

Prefix of the API key

start?string

Starting characters of the key (if configured)

key*string

The full API key (only returned on creation)

enabled*boolean

Whether the key is enabled

expiresAt?string

Expiration timestamp

Formatdate-time
referenceId*string

ID of the reference owning the key

lastRefillAt?string

Last refill timestamp

Formatdate-time
lastRequest?string

Last request timestamp

Formatdate-time
metadata?

Metadata associated with the key

rateLimitMax?number

Maximum requests in time window

rateLimitTimeWindow?number

Rate limit time window in milliseconds

remaining?number

Remaining requests

refillAmount?number

Amount to refill

refillInterval?number

Refill interval in milliseconds

rateLimitEnabled*boolean

Whether rate limiting is enabled

requestCount*number

Current request count in window

permissions?

Permissions associated with the key

curl -X POST 'https://dev.auth.graphxserver.io/api/auth/api-key/create' \  -H 'Content-Type: application/json' \  -d '{}'
{  "id": "string",  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z",  "name": "string",  "prefix": "string",  "start": "string",  "key": "string",  "enabled": true,  "expiresAt": "2019-08-24T14:15:22Z",  "referenceId": "string",  "lastRefillAt": "2019-08-24T14:15:22Z",  "lastRequest": "2019-08-24T14:15:22Z",  "metadata": {},  "rateLimitMax": 0,  "rateLimitTimeWindow": 0,  "remaining": 0,  "refillAmount": 0,  "refillInterval": 0,  "rateLimitEnabled": true,  "requestCount": 0,  "permissions": {    "property1": [      "string"    ],    "property2": [      "string"    ]  }}

/api-key/get

GET
/api-key/get

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Query Parameters

configId?string

The configuration ID to use for the API key lookup. If not provided, the default configuration will be used.

id?string

The id of the Api Key

Response Body

API key retrieved successfully

application/json
  1. response
id*string

ID

name?string

The name of the key

start?string

Shows the first few characters of the API key, including the prefix. This allows you to show those few characters in the UI to make it easier for users to identify the API key.

prefix?string

The API Key prefix. Stored as plain text.

userId*string

The owner of the user id

refillInterval?number

The interval in milliseconds between refills of the remaining count. Example: 3600000 // refill every hour (3600000ms = 1h)

refillAmount?number

The amount to refill

lastRefillAt?string

The last refill date

Formatdate-time
enabled*boolean

Sets if key is enabled or disabled

Defaulttrue
rateLimitEnabled*boolean

Whether the key has rate limiting enabled

rateLimitTimeWindow?number

The duration in milliseconds

rateLimitMax?number

Maximum amount of requests allowed within a window

requestCount*number

The number of requests made within the rate limit time window

remaining?number

Remaining requests (every time api key is used this should updated and should be updated on refill as well)

lastRequest?string

When last request occurred

Formatdate-time
expiresAt?string

Expiry date of a key

Formatdate-time
createdAt*string

created at

Formatdate-time
updatedAt*string

updated at

Formatdate-time
metadata?

Extra metadata about the apiKey

permissions?string

Permissions for the api key (stored as JSON string)

curl -X GET 'https://dev.auth.graphxserver.io/api/auth/api-key/get'
{  "id": "string",  "name": "string",  "start": "string",  "prefix": "string",  "userId": "string",  "refillInterval": 0,  "refillAmount": 0,  "lastRefillAt": "2019-08-24T14:15:22Z",  "enabled": true,  "rateLimitEnabled": true,  "rateLimitTimeWindow": 0,  "rateLimitMax": 0,  "requestCount": 0,  "remaining": 0,  "lastRequest": "2019-08-24T14:15:22Z",  "expiresAt": "2019-08-24T14:15:22Z",  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z",  "metadata": {},  "permissions": "string"}

/api-key/update

POST
/api-key/update

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Request Body

application/json
  1. body
configId?string

The configuration ID to use for the API key lookup. If not provided, the default configuration will be used.

keyId*string

The id of the Api Key

userId?string

The id of the user which the api key belongs to. server-only. Eg: "some-user-id"

name?string

The name of the key

enabled?boolean

Whether the Api Key is enabled or not

remaining?number

The number of remaining requests

refillAmount?number

The refill amount

refillInterval?number

The refill interval

metadata?unknown
expiresIn?|

Expiration time of the Api Key in seconds

rateLimitEnabled?boolean

Whether the key has rate limiting enabled.

rateLimitTimeWindow?number

The duration in milliseconds where each request is counted. server-only. Eg: 1000

rateLimitMax?number

Maximum amount of requests allowed within a window. Once the maxRequests is reached, the request will be rejected until the timeWindow has passed, at which point the timeWindow will be reset. server-only. Eg: 100

permissions?|

Update the permissions on the API Key. server-only.

Response Body

API key updated successfully

application/json
  1. response
id*string

ID

name?string

The name of the key

start?string

Shows the first few characters of the API key, including the prefix. This allows you to show those few characters in the UI to make it easier for users to identify the API key.

prefix?string

The API Key prefix. Stored as plain text.

userId*string

The owner of the user id

refillInterval?number

The interval in milliseconds between refills of the remaining count. Example: 3600000 // refill every hour (3600000ms = 1h)

refillAmount?number

The amount to refill

lastRefillAt?string

The last refill date

Formatdate-time
enabled*boolean

Sets if key is enabled or disabled

Defaulttrue
rateLimitEnabled*boolean

Whether the key has rate limiting enabled

rateLimitTimeWindow?number

The duration in milliseconds

rateLimitMax?number

Maximum amount of requests allowed within a window

requestCount*number

The number of requests made within the rate limit time window

remaining?number

Remaining requests (every time api key is used this should updated and should be updated on refill as well)

lastRequest?string

When last request occurred

Formatdate-time
expiresAt?string

Expiry date of a key

Formatdate-time
createdAt*string

created at

Formatdate-time
updatedAt*string

updated at

Formatdate-time
metadata?

Extra metadata about the apiKey

permissions?string

Permissions for the api key (stored as JSON string)

curl -X POST 'https://dev.auth.graphxserver.io/api/auth/api-key/update' \  -H 'Content-Type: application/json' \  -d '{  "keyId": "string"}'
{  "id": "string",  "name": "string",  "start": "string",  "prefix": "string",  "userId": "string",  "refillInterval": 0,  "refillAmount": 0,  "lastRefillAt": "2019-08-24T14:15:22Z",  "enabled": true,  "rateLimitEnabled": true,  "rateLimitTimeWindow": 0,  "rateLimitMax": 0,  "requestCount": 0,  "remaining": 0,  "lastRequest": "2019-08-24T14:15:22Z",  "expiresAt": "2019-08-24T14:15:22Z",  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z",  "metadata": {},  "permissions": "string"}

/api-key/delete

POST
/api-key/delete

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Request Body

application/json
  1. body
keyId*string

The id of the API key to delete

Response Body

API key deleted successfully

application/json
  1. response
success*boolean

Indicates if the API key was successfully deleted

curl -X POST 'https://dev.auth.graphxserver.io/api/auth/api-key/delete' \  -H 'Content-Type: application/json' \  -d '{  "keyId": "string"}'
{  "success": true}

/api-key/list

GET
/api-key/list

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Response Body

API keys retrieved successfully

application/json
  1. response
apiKeys*array<>
total*number

Total number of API keys

limit?number

The limit used for pagination

offset?number

The offset used for pagination

curl -X GET 'https://dev.auth.graphxserver.io/api/auth/api-key/list'
{  "apiKeys": [    {      "id": "string",      "name": "string",      "start": "string",      "prefix": "string",      "userId": "string",      "refillInterval": 0,      "refillAmount": 0,      "lastRefillAt": "2019-08-24T14:15:22Z",      "enabled": true,      "rateLimitEnabled": true,      "rateLimitTimeWindow": 0,      "rateLimitMax": 0,      "requestCount": 0,      "remaining": 0,      "lastRequest": "2019-08-24T14:15:22Z",      "expiresAt": "2019-08-24T14:15:22Z",      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z",      "metadata": {},      "permissions": "string"    }  ],  "total": 0,  "limit": 0,  "offset": 0}