Api-key
bearerAuthAuthorizationBearer <token>Bearer token authentication
application/json- body
configId?stringThe configuration ID to use for the API key. If not provided, the default configuration will be used.
name?stringName of the Api Key
expiresIn?|Expiration time of the Api Key in seconds
prefix?stringPrefix of the Api Key
remaining?|Remaining number of requests. Server side only
metadata?unknownrefillAmount?numberAmount to refill the remaining count of the Api Key. server-only. Eg: 100
refillInterval?numberInterval to refill the Api Key in milliseconds. server-only. Eg: 1000
rateLimitTimeWindow?numberThe 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?numberMaximum 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?booleanWhether the key has rate limiting enabled. server-only. Eg: true
permissions?Permissions of the Api Key.
userId?stringUser Id of the user that the Api Key belongs to. server-only. Eg: "user-id"
organizationId?stringOrganization Id of the organization that the Api Key belongs to. Eg: 'org-id'
API key created successfully
application/json- response
id*stringUnique identifier of the API key
createdAt*stringCreation timestamp
date-timeupdatedAt*stringLast update timestamp
date-timename?stringName of the API key
prefix?stringPrefix of the API key
start?stringStarting characters of the key (if configured)
key*stringThe full API key (only returned on creation)
enabled*booleanWhether the key is enabled
expiresAt?stringExpiration timestamp
date-timereferenceId*stringID of the reference owning the key
lastRefillAt?stringLast refill timestamp
date-timelastRequest?stringLast request timestamp
date-timemetadata?Metadata associated with the key
rateLimitMax?numberMaximum requests in time window
rateLimitTimeWindow?numberRate limit time window in milliseconds
remaining?numberRemaining requests
refillAmount?numberAmount to refill
refillInterval?numberRefill interval in milliseconds
rateLimitEnabled*booleanWhether rate limiting is enabled
requestCount*numberCurrent 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" ] }}bearerAuthAuthorizationBearer <token>Bearer token authentication
configId?stringThe configuration ID to use for the API key lookup. If not provided, the default configuration will be used.
id?stringThe id of the Api Key
API key retrieved successfully
application/json- response
id*stringID
name?stringThe name of the key
start?stringShows 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?stringThe API Key prefix. Stored as plain text.
userId*stringThe owner of the user id
refillInterval?numberThe interval in milliseconds between refills of the remaining count. Example: 3600000 // refill every hour (3600000ms = 1h)
refillAmount?numberThe amount to refill
lastRefillAt?stringThe last refill date
date-timeenabled*booleanSets if key is enabled or disabled
truerateLimitEnabled*booleanWhether the key has rate limiting enabled
rateLimitTimeWindow?numberThe duration in milliseconds
rateLimitMax?numberMaximum amount of requests allowed within a window
requestCount*numberThe number of requests made within the rate limit time window
remaining?numberRemaining requests (every time api key is used this should updated and should be updated on refill as well)
lastRequest?stringWhen last request occurred
date-timeexpiresAt?stringExpiry date of a key
date-timecreatedAt*stringcreated at
date-timeupdatedAt*stringupdated at
date-timemetadata?Extra metadata about the apiKey
permissions?stringPermissions 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"}bearerAuthAuthorizationBearer <token>Bearer token authentication
application/json- body
configId?stringThe configuration ID to use for the API key lookup. If not provided, the default configuration will be used.
keyId*stringThe id of the Api Key
userId?stringThe id of the user which the api key belongs to. server-only. Eg: "some-user-id"
name?stringThe name of the key
enabled?booleanWhether the Api Key is enabled or not
remaining?numberThe number of remaining requests
refillAmount?numberThe refill amount
refillInterval?numberThe refill interval
metadata?unknownexpiresIn?|Expiration time of the Api Key in seconds
rateLimitEnabled?booleanWhether the key has rate limiting enabled.
rateLimitTimeWindow?numberThe duration in milliseconds where each request is counted. server-only. Eg: 1000
rateLimitMax?numberMaximum 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.
API key updated successfully
application/json- response
id*stringID
name?stringThe name of the key
start?stringShows 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?stringThe API Key prefix. Stored as plain text.
userId*stringThe owner of the user id
refillInterval?numberThe interval in milliseconds between refills of the remaining count. Example: 3600000 // refill every hour (3600000ms = 1h)
refillAmount?numberThe amount to refill
lastRefillAt?stringThe last refill date
date-timeenabled*booleanSets if key is enabled or disabled
truerateLimitEnabled*booleanWhether the key has rate limiting enabled
rateLimitTimeWindow?numberThe duration in milliseconds
rateLimitMax?numberMaximum amount of requests allowed within a window
requestCount*numberThe number of requests made within the rate limit time window
remaining?numberRemaining requests (every time api key is used this should updated and should be updated on refill as well)
lastRequest?stringWhen last request occurred
date-timeexpiresAt?stringExpiry date of a key
date-timecreatedAt*stringcreated at
date-timeupdatedAt*stringupdated at
date-timemetadata?Extra metadata about the apiKey
permissions?stringPermissions 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"}bearerAuthAuthorizationBearer <token>Bearer token authentication
application/json- body
keyId*stringThe id of the API key to delete
API key deleted successfully
application/json- response
success*booleanIndicates 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}bearerAuthAuthorizationBearer <token>Bearer token authentication
API keys retrieved successfully
application/json- response
apiKeys*array<>total*numberTotal number of API keys
limit?numberThe limit used for pagination
offset?numberThe 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}