Skip to content
Username & Password

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.

ParameterInTypeRequiredDescription
organizationIdPathstringYesOrganization ID.
contextIdPathstringYesSign-In Context ID.
x-auth-tokenHeaderstringYesContext API key.
usernameBodystringYesUsername. Must be unique within the Context.
passwordBodystringYesPassword. Must satisfy the Context’s password policy.

Request example

cURL
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"
}'
Node.js
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',
}),
});
FieldTypeDescription
usernamestringThe created user’s username. Echoes the request.
passwordstringThe user’s password. Echoes the request — keep the transport encrypted.

Response example

200
{
"username": "alice.smith",
"password": "Bx7-qMfeQ9"
}

Next