Lists users. Without limit every match comes back. The example selects no names, because the hub’s users are colleagues.
Accounts
User accounts, the signed-in user’s own account, and the forgotten-password request.
List users#
/cdna-api/users/users
- Access
- Admin users and integrations, with an OAuth access token or an API key.
- Model
- User, in the Reference
Parameters
propertiesquery- selector
- The fields and relations to return, such as
{id,type,active}. filtersquery- name=value
- Any stored field, or a relation with a dot, such as
parent.id=12. Prefix the name with!,>,<,%or|. Use stored field names exactly as in the model, and comparetotalCountwith the unfiltered list's to confirm a filter applied. orderByquery- string
field:ASCorfield:DESC, comma-separated. Stored fields only.limitquery- integer
- Records per response. There is no default.
offsetquery- integer
- Records to skip.
Example
GET /cdna-api/users/users?limit=2&properties={id,type,active} HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json{
"result": "success",
"totalCount": 24,
"data": [
{
"id": 27,
"type": "frontend",
"active": true
},
{
"id": 8,
"type": "admin",
"active": true
}
]
}Show a user#
/cdna-api/users/user/{id}
Reads one user by its id.
- Access
- Admin users and integrations, with an OAuth access token or an API key.
- Model
- User, in the Reference
Parameters
idpathrequired- integer
- The user id.
propertiesquery- selector
- The fields and relations to return, such as
{id,username,fullName,type}.
Example
GET /cdna-api/users/user/63?properties={id,username,fullName,type} HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json{
"result": "success",
"data": {
"id": 63,
"username": "person@example.com",
"fullName": "API docs bot",
"type": "developer"
}
}Create a user#
/cdna-api/users/user
Creates a user.
- Access
- Admin users and integrations, with an OAuth access token or an API key.
- Returns
- The new user under
data.user, and amessage.
Parameters
usernamebody- string
- The sign-in name, often the email address. Required.
emailbody- string
- The email address.
firstNamebody- string
- The first name.
lastNamebody- string
- The last name.
Example
POST /cdna-api/users/user HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Content-Type: application/json
{
"username": "person@example.com",
"email": "person@example.com",
"firstName": "Alex",
"lastName": "Example"
}Edit a user#
/cdna-api/users/user/{id}
Changes a user. Fields left out keep their values.
- Access
- Admin users and integrations, with an OAuth access token or an API key.
- Returns
- The saved user under
data.user, and amessage.
Parameters
idpathrequired- integer
- The user id.
lastNamebody- string
- The last name.
Example
PUT /cdna-api/users/user/50 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Content-Type: application/json
{
"lastName": "Example-Smith"
}Delete a user#
/cdna-api/users/user/{id}
Deletes a user.
- Access
- Admin users and integrations, with an OAuth access token or an API key.
Parameters
idpathrequired- integer
- The user id.
Example
DELETE /cdna-api/users/user/50 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/jsonShow your own account#
/cdna-api/users/account
Reads the signed-in user’s own account. A member may call it as well as an admin user.
- Access
- A signed-in member, for their own records, and admin users.
- Model
- User, in the Reference
Parameters
propertiesquery- selector
- The fields and relations to return, such as
{user{id,username,fullName}}.
Example
GET /cdna-api/users/account?properties={user{id,username,fullName}} HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json{
"result": "success",
"data": {
"user": {
"id": 63,
"username": "person@example.com",
"fullName": "API docs bot"
}
}
}Edit your own account#
/cdna-api/users/account
Changes the signed-in user’s own account. Unlike reading it, this route refuses members with 403, so a member area changes the account another way.
- Access
- Admin users and integrations, with an OAuth access token or an API key.
- Returns
- The saved account under
data.user, and amessage.
Parameters
firstNamebody- string
- The first name.
lastNamebody- string
- The last name.
emailbody- string
- The email address.
Example
PUT /cdna-api/users/account HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Content-Type: application/json
{
"firstName": "Alex",
"lastName": "Example",
"email": "person@example.com"
}Send a password reset email#
/cdna-api/forgot-password
Emails a password reset link. It answers success whether or not the address belongs to an account, so the route cannot be used to find out who has one.
- Access
- Anyone. The route takes no credentials, by design.
Parameters
emailbodyrequired- string
- The address the account signs in with.
resetUrlbody- string
- Your own reset page; the link in the email signs the person in there with a one-time token.
Example
POST /cdna-api/forgot-password HTTP/1.1
Host: hub.coredna.com
Accept: application/json
Content-Type: application/json
{
"email": "person@example.com",
"resetUrl": "https://your-domain.com/custom-reset-password-url"
}{
"result": "success",
"data": [],
"message": "If a user account with the specified email address exists, a password reset link has been sent to it."
}Register#
/cdna-api/register
Creates a member account, when registration is on in the site’s settings; when it is off the route is a 404. The account’s type, status and groups come from those settings. It does not sign the person in: send them through the OAuth authorization flow next.
- Access
- Anyone. The route takes no credentials, by design.
- Returns
- HTTP 201 with the new account under
data.userand the message “Successfully Registered”. A failed reCAPTCHA is “Recaptcha validation failed”.
Parameters
emailbodyrequired- string
- The email address, which is also the sign-in name unless
usernameis sent. passwordbodyrequired- string
- The password. Send
confirmPasswordwith it: the length and match rules run only when it is there. confirmPasswordbodyrequired- string
- The password again.
firstName, lastNamebody- string
- The person’s name.
g-recaptcha-responsebody- string
- The reCAPTCHA answer, when the site’s registration uses one.
Example
POST /cdna-api/register HTTP/1.1
Host: hub.coredna.com
Accept: application/json
Content-Type: application/json
{
"email": "alex@example.com",
"password": "a-long-passphrase",
"confirmPassword": "a-long-passphrase",
"firstName": "Alex",
"lastName": "Example"
}Set a new password#
/cdna-api/reset-password
The second step of a password reset: sets the password with the token from the reset email, which Send a password reset email sends. The token works once. An unknown, used or expired token, or an inactive account, is a 404.
- Access
- Anyone. The route takes no credentials, by design.
- Returns
- The message “The password has been successfully changed”.
Parameters
tokenbodyrequired- string
- The token from the reset link.
passwordbodyrequired- string
- The new password.
Example
POST /cdna-api/reset-password HTTP/1.1
Host: hub.coredna.com
Accept: application/json
Content-Type: application/json
{
"token": "THE-TOKEN-FROM-THE-EMAIL",
"password": "a-new-passphrase"
}{
"result": "error",
"message": "Page or record not found"
}Create a login token#
/cdna-api/users/login-token
Makes a sign-in link for a user: whoever holds the token is signed in as that user, up to maxUses times and until it expires. Admin users only; it is what password reset emails are built on.
- Access
- Admin users and integrations, with an OAuth access token or an API key.
- Returns
- The new token under
data.loginToken, with the generatedtoken. - Model
- LoginToken, in the Reference
Parameters
userbodyrequired- integer
- The user it signs in as.
maxUsesbody- integer
- How many times it works.
expiresbody- datetime
- When it stops working.
expireTimeAfterUsebody- integer
- How long it keeps working after its first use.
redirectUrlbody- string
- Where the person lands after signing in.
A login token is as good as the user’s password. Send it only to that person, give it one use and a short life, and never log it.
Example
POST /cdna-api/users/login-token HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Content-Type: application/json
{
"user": 50,
"maxUses": 1,
"expires": "2026-10-19T00:00:00+11:00",
"redirectUrl": "/my-account"
}Revoke an app’s access#
/cdna-api/users/user/{userId}/revokeAppAccess/{appId}
Withdraws a user’s approval of an OAuth app and revokes the tokens it holds for them. There is no body.
- Access
- Admin users and integrations, with an OAuth access token or an API key.
- Returns
{"result":"success"}.
Parameters
userIdpathrequired- integer
- The user id.
appIdpathrequired- integer
- The OAuth client’s id.
Example
POST /cdna-api/users/user/50/revokeAppAccess/3 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/jsonLearn more
Revoke access tokens#
/cdna-api/users/user/{userId}/revokeAccessToken/{tokenId}
Revokes one of a user’s OAuth access tokens, or every one when the path ends at revokeAccessToken: the way to sign a user out of every app at once.
- Access
- Admin users and integrations, with an OAuth access token or an API key.
- Returns
{"result":"success"}.
Parameters
userIdpathrequired- integer
- The user id.
tokenIdpath- integer
- The token’s id; left out, all of them.
Example
DELETE /cdna-api/users/user/50/revokeAccessToken/812 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json