Skip to content

Create User

Create a new user in your organisation with optional profile information.

Endpoint

http
POST /v1/users

Authentication

Required Scope: pearsana-partner/partners.users:write

Headers

http
Authorization: Bearer YOUR_ACCESS_TOKEN
Content-Type: application/json
X-API-Version: 2026-01-30

Request Body

Minimal Request

json
{
	"identity": {
		"email": "student@example.com",
		"firstName": "Jane",
		"lastName": "Smith",
		"roleName": "student"
	},
	"externalReferences": [
		{
			"namespace": "SIS",
			"externalId": "STU-2024-001"
		}
	]
}

Full Request with Profile

json
{
	"identity": {
		"email": "student@example.com",
		"firstName": "Jane",
		"lastName": "Smith",
		"roleName": "student"
	},
	"externalReferences": [
		{
			"namespace": "SIS",
			"externalId": "STU-2024-001"
		},
		{
			"namespace": "PEARSANA",
			"externalId": "PEARSANA-123456"
		}
	],
	"profile": {
		"preferredName": "Jane",
		"phone": "+1-555-123-4567",
		"currency": "USD",
		"address": {
			"line1": "123 University Ave",
			"line2": "Apt 4B",
			"city": "Boston",
			"state": "MA",
			"zip": "02134",
			"country": "United States",
			"dateOfBirth": "2000-05-15",
			"citizenship": "United States"
		}
	}
}

Request Parameters

Identity Object (Required)

FieldTypeRequiredDescription
emailstringYesValid email address
firstNamestringYesFirst name
lastNamestringYesLast name
roleNamestringYesUser role (e.g. "student", "faculty")

External References Array (Required)

Minimum 1 entry required.

FieldTypeRequiredDescription
namespacestringYesSystem namespace (e.g. "SIS", "LMS", "PEARSANA")
externalIdstringYesExternal system identifier

Profile Object (Optional)

FieldTypeDescription
preferredNamestringPreferred / display name
phonestringPhone number
currencystringCurrency code (e.g. "USD", "GBP", "EUR")
addressobjectAddress information (see below)

Address Object (Optional)

FieldTypeDescription
line1stringStreet address line 1
line2stringStreet address line 2
line3stringStreet address line 3
citystringCity
statestringState / region
zipstringPostal code
countrystringCountry
dateOfBirthstringDate of birth (YYYY-MM-DD)
citizenshipstringCitizenship country

Response

Success Response

Status Code: 201 Created

json
{
	"userId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
	"email": "student@example.com",
	"organisationId": "org_abc123",
	"status": "created"
}
FieldTypeDescription
userIdstringUnique user identifier
emailstringUser's email address (normalised to lowercase)
organisationIdstringOrganisation ID (derived from JWT)
statusstringAlways "created" for successful requests

Error Responses

400 Validation Error

json
{
	"error": {
		"code": "VALIDATION_ERROR",
		"message": "Validation failed",
		"details": {
			"errors": ["identity.email is required", "identity.roleName is required"]
		},
		"requestId": "abc-123-def"
	}
}

401 Unauthorized

json
{
	"error": {
		"code": "UNAUTHORIZED",
		"message": "Authentication required.",
		"requestId": "abc-123-def"
	}
}

403 Insufficient Scope

json
{
	"error": {
		"code": "INSUFFICIENT_SCOPE",
		"message": "Insufficient OAuth scopes for this operation.",
		"details": {
			"requiredScopes": ["pearsana-partner/partners.users:write"],
			"providedScopes": ["pearsana-partner/ping"]
		},
		"requestId": "abc-123-def"
	}
}

409 Duplicate Email

json
{
	"error": {
		"code": "CONFLICT",
		"message": "User with this email already exists",
		"details": {
			"userId": "existing-user-id",
			"email": "student@example.com"
		},
		"requestId": "abc-123-def"
	}
}

500 Internal Server Error

json
{
	"error": {
		"code": "INTERNAL_SERVER_ERROR",
		"message": "An unexpected error occurred.",
		"requestId": "abc-123-def"
	}
}

Example Request

bash
curl -X POST https://sandbox.api.pearsana.com/v1/users \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -H "X-API-Version: 2026-01-30" \
  -d '{
    "identity": {
      "email": "student@example.com",
      "firstName": "Jane",
      "lastName": "Smith",
      "roleName": "student"
    },
    "externalReferences": [
      {
        "namespace": "SIS",
        "externalId": "STU-2024-001"
      }
    ]
  }'