Skip to main content

Get User API Keys

GET 

/company/apikey/

Retrieves all API Keys created by the authenticated user.

Operation Flow:

  1. Validate that the user exists and belongs to a company
  2. Find all keys associated with the user's ID
  3. Partially hide the keys for security (display first 8 and last 4 characters)
  4. Return the list of keys with their metadata

Important Considerations:

  • Keys are displayed partially hidden for security
  • To obtain a complete key, a new one must be created
  • Requires valid JWT authentication
  • Only returns the user's own keys

Response Example:

{
apikeys: [
{
key: sk_live_*****cdef,
type: write,
created_at: 2024-01-15T10:30:00Z
},
{
key: sk_test_*****1234,
type: read,
created_at: 2024-01-10T08:15:00Z
}
]
}

Possible Errors:

  • 401: Not authenticated or invalid token
  • 404: User not found or has no registered keys

Responses

List of API Keys