Identity
Retrieve information about the currently authenticated user and API connection.
Endpoints Overview
| Method | Endpoint | Description |
|---|---|---|
GET |
/v1/identity |
Get current user context |
Get Current User Context
Retrieve details about the authenticated user and their organization.
Endpoint: GET /v1/identity
Request Example
curl -X GET "https://api.consignlyhq.com/v1/identity" \
-H "Authorization: Bearer ACCESS_TOKEN"
Response Example
{
"identityConnectionId": "550e8400-e29b-41d4-a716-446655448000",
"userId": "550e8400-e29b-41d4-a716-446655448001",
"userFullName": "John Smith",
"organisationId": "550e8400-e29b-41d4-a716-446655448002",
"organisationName": "Example Logistics Co",
"partnerId": "550e8400-e29b-41d4-a716-446655448003",
"partnerCode": "ELC",
"partnerName": "Example Logistics Co"
}
Response Fields
| Field | Type | Description |
|---|---|---|
identityConnectionId |
uuid | API connection ID |
userId |
uuid | User ID |
userFullName |
string | User's full name |
organisationId |
uuid | Organization ID |
organisationName |
string | Organization name |
partnerId |
uuid | Associated partner ID (if applicable) |
partnerCode |
string | Associated partner code (if applicable) |
partnerName |
string | Associated partner name (if applicable) |
Use Cases
Verify Authentication
Use this endpoint to verify that your access token is valid and see which user/organization you're authenticated as:
# Test your authentication
curl -X GET "https://api.consignlyhq.com/v1/identity" \
-H "Authorization: Bearer ACCESS_TOKEN"
# If successful, you'll see your user details
# If token is invalid/expired, you'll get a 401 error
Get Organization Context
The identity response provides the organization context for your API requests. This is useful for:
- Confirming you're connected to the correct organization
- Getting the
organisationIdfor any operations that need it - Identifying the associated partner (if your connection is partner-scoped)
Partner-Scoped Connections
If your API connection is associated with a specific partner (e.g., a client portal integration), the partnerId, partnerCode, and partnerName fields will be populated. This indicates that your API access is scoped to that partner's data.
Error Cases
| Status | Cause | Resolution |
|---|---|---|
401 |
Invalid or expired token | Refresh your access token |
403 |
Token lacks required permissions | Check API scopes |
Related Endpoints
- Authentication - How to obtain access tokens