Create user
Create a username/password user account inside a Sign-In Context.
POST /v1/org/{organizationId}/contexts/sign-in/{contextId}/modules/up/create
Creates a new username/password user. The Context’s Username and Password module must be enabled. Duplicate usernames are rejected at validation time.
Request
Section titled “Request”| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organizationId | Path | string | Yes | Organization ID. |
contextId | Path | string | Yes | Sign-In Context ID. |
x-auth-token | Header | string | Yes | Context API key. |
username | Body | string | Yes | Username. Must be unique within the Context. |
password | Body | string | Yes | Password. Must satisfy the Context’s password policy. |
Request example
curl -X POST "$API_BASE_URL/v1/org/$ORG_ID/contexts/sign-in/$CTX_ID/modules/up/create" \ -H "x-auth-token: $NETGRAPH_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "username": "alice.smith", "password": "Bx7-qMfeQ9" }'await fetch(`${apiBaseUrl}/v1/org/${orgId}/contexts/sign-in/${ctxId}/modules/up/create`, { method: 'POST', headers: { 'x-auth-token': process.env.NETGRAPH_API_TOKEN, 'Content-Type': 'application/json', }, body: JSON.stringify({ username: 'alice.smith', password: 'Bx7-qMfeQ9', }),});Response
Section titled “Response”| Field | Type | Description |
|---|---|---|
username | string | The created user’s username. Echoes the request. |
password | string | The user’s password. Echoes the request — keep the transport encrypted. |
Response example
{ "username": "alice.smith", "password": "Bx7-qMfeQ9"}