Skip to main content
User Details API
curl --request GET \
  --url https://api.pazy.io/v1.0/user/:id

Authentication

All requests require an API key in the request headers. Headers:
Authorization: Api-Key YOUR_API_KEY

Request

Content-Type: application/json

Path Parameters

ParameterTypeRequiredDescription
idstringYesThe unique identifier of the User to retrieve. If you pass ‘me’ as param, it gives your details

Code Examples

curl -X GET https://api.pazy.io/v1.0/user/uNTwHYj1PFedam5Q \
  -H "Authorization: Api-Key YOUR_API_KEY"

Success Response

HTTP Status: 200 OK Response Fields:
FieldTypeDescription
okbooleanIndicates whether the request was successful
dataobjectContains the user response data
data.idstringUnique identifier for the user
data.namestringName of the user
data.emailstringEmail address of the user
data.rolestringRole of the user in the organization e.g. ADMIN, MEMBER
data.organizationobjectInformation about the user’s organization
data.organization.idstringUnique identifier for the organization
data.organization.namestringName of the organization

Response Example

{
  "ok": true,
  "data": {
    "id": "uNTwHYj1PFemak5Q",
    "name": "John Doe",
    "email": "[email protected]",
    "role": "ADMIN",
    "organization": {
      "id": "zb5qeampgilj",
      "name": "JOHN DOE ORG PRIVATE LIMITED"
    }
  }
}

Error Responses

Missing User ID

HTTP Status: 400 Bad Request
{
  "ok": false,
  "error": {
    "code": "MISSING_REQUIRED_FIELD",
    "message": "User ID is required"
  }
}

User Not Found

HTTP Status: 404 Not Found
{
  "ok": false,
  "error": {
    "code": "USER_NOT_FOUND",
    "message": "User not found"
  }
}

Access Denied

HTTP Status: 403 Forbidden
{
  "ok": false,
  "error": {
    "code": "ACCESS_DENIED",
    "message": "Access denied: You can only view your own users or users where you are the user owner"
  }
}

Authentication Errors

HTTP Status: 401 Unauthorized
{
  "ok": false,
  "error": {
    "code": "MISSING_CREDENTIALS",
    "message": "Missing Credentials"
  }
}
{
  "ok": false,
  "error": {
    "code": "INVALID_API_KEY",
    "message": "Invalid API Key"
  }
}

Permission Errors

HTTP Status: 403 Forbidden
{
  "ok": false,
  "error": {
    "code": "INSUFFICIENT_PERMISSIONS",
    "message": "Permission check failed - PERMISSION_CHECK_FAILED"
  }
}

Best Practices

Access Control

  • Only your data you can view. You can view all users data, only if you are ‘admin’.