Skip to main content
POST https://xquik.com/api/v1/api-keys

When to create a key

Use this route only when creating a new credential. fullKey appears at creation, so store it immediately in a secret manager. List operations return inventory data and never replace this storage step. Give each workload only the scopes it needs. A key that only reads X (Twitter) data needs ["read"]. Set expiresInDays so a forgotten key stops working on its own. Set allowedIps so only your servers can use the key. Calls from other IPs get 403 ip_not_allowed. Set monthlyBudgetCredits to cap what the key spends each UTC calendar month.
Free. This endpoint does not consume credits.
Store fullKey immediately and log only id and prefix.

Headers

Body

Response

201 Created

Xquik returns fullKey once. Store it in a secret manager. You cannot retrieve it again.

400 Invalid input

{ "error": "invalid_input", "message": "Set expiresInDays to a whole number from 1 to 365." } scope is not full or paid_reads, or a scopes entry is not a scope. An expiresInDays outside 1 to 365 fails too. So does a name longer than 100 characters. An allowedIps entry that isn’t an IP or CIDR range fails too. So does a list over 20 entries. So does a monthlyBudgetCredits that isn’t a whole number from 1 to 1,000,000,000,000. The message names the field to fix. Xquik creates no key.

401 Unauthenticated

Missing, expired, or invalid dashboard session cookie.

403 Key limit reached

{ "error": "api_key_limit_reached", "limit": 10000, "message": "API key limit reached. Delete an existing key first." } You have reached the maximum number of active API keys (10,000). Revoke an active key before creating a new one. Revoked keys do not count toward the active limit.

429 Rate limited

Too many requests. Wait for the Retry-After header before retrying.
API key creation requires a same-origin dashboard session. API keys and OAuth bearer tokens cannot create more keys.Related.

Response examples

  • 400 { "error": "invalid_input", "message": "Invalid input. Check the request body." }
  • 401 { "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }
  • 403 { "error": "api_key_limit_reached", "message": "API key limit reached. Delete an existing key first." }
  • 429 { "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }