Create an API key
Creates a scoped credential. The key secret is returned in this response only and can never be retrieved again. Supplied scopes are canonicalized, and may not exceed the caller's own permissions.
bearerAuthAuthorizationBearer <token>Use a Voice API key or connected-app OAuth access token. Authentication.
Idempotency-Key*stringRequired. Reuse the same key to retry this write safely. Retries and idempotency.
^[A-Za-z0-9!#$%&'*+.^_`|~-]+$1 <= length <= 255application/json- body
Supply either expires_in_days or expires_at, not both. Omit both for a non-expiring credential.
name*string1 <= length <= 120scopes*array<string>1 <= items <= 256expires_in_days?integerRelative lifetime in whole days from creation; mutually exclusive with expires_at.
1 <= value <= 3650expires_at?stringRFC 3339 instant strictly after the request time and no more than 3650 days in the future; mutually exclusive with expires_in_days.
date-timeAPI key metadata plus the one-time secret.
application/json- response
Complete safe metadata plus the one-time credential secret.
id*stringuuidprefix*string1 <= lengthname*string1 <= length <= 120scopes*array<string>1 <= items <= 256status*string"active""expired""revoked"created_by_user_id*|uuidcreated_by_api_key_id*|uuidlast_used_at*|date-timeexpires_at*|date-timerevoked_at*|date-timeversion*integerint641 <= valuecreated_at*stringdate-timeupdated_at*stringdate-timekey*string1 <= lengthcurl -X POST 'https://api.kejue.co/v1/api-keys' \ -H 'Idempotency-Key: string' \ -H 'Content-Type: application/json' \ -d '{ "name": "string", "scopes": [ "string" ]}'{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "prefix": "string", "name": "string", "scopes": [ "string" ], "status": "active", "created_by_user_id": "209f54c4-4c33-43bc-9c6a-ef4c65ad7473", "created_by_api_key_id": "16a8c1ea-aaaf-49f0-9266-c657c48ceff3", "last_used_at": "2019-08-24T14:15:22Z", "expires_at": "2019-08-24T14:15:22Z", "revoked_at": "2019-08-24T14:15:22Z", "version": 1, "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z", "key": "string"}