EGP User Account Service
  1. API Keys
EGP User Account Service
  • Overview
  • Invitations
    • Accept an organization invitation
      POST
    • Send an invitation to join an organization
      POST
  • Authentication
    • Login with email/password
      POST
    • Register a new global user
      POST
    • Exchange user token for service token
      POST
    • Get a challenge for Web3 signing
      POST
    • Verify Web3 signature and login
      POST
  • Organizations
    • Create a new organization
      POST
    • Get organization details
      GET
    • Get organization settings
      GET
    • Update organization settings
      PUT
    • List members of an organization
      GET
    • Directly add an existing user to the organization
      POST
    • Remove a member from an organization
      DELETE
    • Get a specific member's details
      GET
    • Update a member's role
      PUT
  • SSO
    • Request Challenge for Web3 SSO (EVM Only)
      POST
    • Initiate Web3 SSO Flow (IdP Start)
      GET
    • Verify SIWE Signature & Issue Token for Web3 SSO (EVM Only)
      POST
  • Applications
    • Delete an application
      DELETE
    • Get application details
      GET
    • Update application details
      PUT
    • List applications within an organization
      GET
    • Create an application within an organization
      POST
  • API Keys
    • Revoke an API key
      DELETE
    • List API keys for an application
      GET
    • Generate an API key for an application
      POST
  • User Self-Service
    • Get current user's profile
    • Update current user's profile
    • Update current user's password
  • Custom System Data
    • List users with custom system data
    • Get user's custom system data
    • Set/Update user's custom system data
  • Custom Data
    • Get user's custom data
    • Set/Update user's custom data
  • Inventory
    • List inventory items for an application
    • Create or update an inventory item
  1. API Keys

Generate an API key for an application

POST
/api/v1/apps/{appId}/apikeys
Creates a new API key associated with the specified application. Requires JWT authentication and the user must be an Admin or Owner of the application's organization. Owners get all permissions; Admins get requested permissions.
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://useraccounts.srblabs.io/api/v1/apps//apikeys' \
--header 'Content-Type: application/json' \
--data-raw '{
    "description": "Analytics Service Key",
    "expires_in_days": 90,
    "permissions": [
        "event:record",
        "inventory:write"
    ]
}'
Response Response Example
201 - Example 1
{
    "api_key_details": {
        "application_id": "c3d4e5f6-a7b8-9012-3456-7890abcdef01",
        "created_at": "2023-10-26T11:00:00Z",
        "description": "CI/CD Deployment Key",
        "expires_at": "2024-10-25T11:00:00Z",
        "id": "d4e5f6a7-b8c9-0123-4567-890abcdef012",
        "key_prefix": "ask_abcd",
        "last_used": "2023-10-26T11:00:00Z",
        "permissions": [
            "event:record",
            "inventory:read"
        ],
        "revoked_at": "2023-11-01T09:00:00Z"
    },
    "raw_key": "ask_abcd1234xyz..............................."
}

Request

Path Params

Body Params application/json

Examples

Responses

🟢201Created
application/json
API Key created successfully. Includes the raw key (only shown once).
Body

🟠400Bad Request
🟠401Unauthorized
🟠403Forbidden
🟠404Record Not Found
🔴500Server Error
Modified at 2025-05-03 01:39:03
Previous
List API keys for an application
Next
Get current user's profile