openapi: 3.0.3
info:
contact:
email: support@marqeta.com
name: Marqeta
description: Marqeta's Core API endpoints, conveniently annotated to enable code generation (including SDKs), test cases, and documentation. Currently in beta.
termsOfService: https://www.marqeta.com/api-terms
title: Core accepted countries Users API
version: 3.0.39
servers:
- url: /v3
security:
- mqAppAndAccessToken: []
tags:
- description: '// Conditional snippet for beta or internal content
include::../../maturity-admonition-banner.adoc[]
// This source file is used by InfoDev to generate API reference documentation.
// File location in GitHub is:
// https://github.marqeta.com/openapi/coreapi/blob/main/openapi/users/openapi.yaml
The `users` resource represents a person who accesses Marqeta-administered funds via a Marqeta card (whether physical or virtual).
This endpoint enables you to create and manage users on the Marqeta platform.
This resource stores user attributes such as name, address, and date of birth, as well as financial information such as balances.
By default, every user automatically has a general purpose account (GPA) that is used for the funding of transfers and is therefore an `account holder`.
Note that account balances reside at the account holder level — there are no separate `account` or `balance` objects.
You can use the `/users` endpoint to create parent-child relationships between two users (where one user is the parent and the other is the child) or between a business and a user (where the business is the parent and the user is the child).
This relationship provides reporting to the parent about how cards of children are used and enables the parent to monitor and even restrict card usage.
[NOTE]
A user can simultaneously be a child of a business and a parent of other users if the user is not configured to use a parent''s account balances and the user''s child is configured to use a parent''s account balances.
For more information on account holders, see <</developer-guides/about-account-holders, About Account Holders>>.'
name: Users
paths:
/users:
get:
description: 'To return an array of all of a program''s users, send a `GET` request to the `/users` endpoint.
This endpoint supports <</core-api/field-filtering, field filtering>> and <</core-api/sorting-and-pagination, pagination>>.
To narrow your result set to users that match certain criteria, see the <<search_users,Search users>> endpoint.
The `business_token` field is conditionally returned in the response (it cannot be set through the API).
You can use this field in conjunction with the `parent_token` field to determine whether the user has a parent or grandparent that is a business:
[cols="1,1,1"]
|===
| parent_token | business_token | Description
| Not populated
| Not populated
| User does not have a parent.
| Populated
| Not populated
| User''s parent is a user.
| Populated; matches `business_token`
| Populated; matches `parent_token`
| User''s parent is a business.
| Populated; does not match `business_token`
| Populated; does not match `parent_token`
| User''s parent is a user and their grandparent is a business.
|==='
operationId: getUsers
parameters:
- description: Number of user resources to retrieve.
explode: true
in: query
name: count
required: false
schema:
default: 5
format: int32
type: integer
style: form
- description: Sort order index of the first resource in the returned array.
explode: true
in: query
name: start_index
required: false
schema:
default: 0
format: int32
type: integer
style: form
- description: Search type.
explode: true
in: query
name: search_type
required: false
schema:
type: string
style: form
- description: 'Comma-delimited list of fields to return (`field_1,field_2`, and so on).
Leave blank to return all fields.'
explode: true
in: query
name: fields
required: false
schema:
type: string
style: form
- description: 'Field on which to sort.
Use any field in the resource model, or one of the system fields `lastModifiedTime` or `createdTime`.
Prefix the field name with a hyphen (`-`) to sort in descending order.
Omit the hyphen to sort in ascending order.'
explode: true
in: query
name: sort_by
required: false
schema:
default: -lastModifiedTime
type: string
style: form
responses:
'200':
content:
application/json:
example:
count: 2
data:
- account_holder_group_token: DEFAULT_AHG
active: true
address1: 1234 Grove Street
birth_date: 1991-01-01
city: Berkeley
country: USA
created_time: 2022-08-16 19:43:02+00:00
email: jane.doe@company.com
first_name: Jane
gender: F
identifications:
- type: SSN
value: '5555'
last_modified_time: 2022-08-16 19:43:02+00:00
last_name: Doe
metadata:
authentication_answer1: Cashier
authentication_answer2: Trabant
authentication_answer3: Blue
authentication_question1: What was your first job?
authentication_question2: What make was your first car?
authentication_question3: What is your favorite color?
notification_email: jane.doe@home.com
notification_language: spa
password: P@ssw0rd
phone: '15105551212'
postal_code: '94702'
state: CA
status: ACTIVE
token: my_user_01
uses_parent_account: false
- account_holder_group_token: DEFAULT_AHG
active: true
address1: 2345 Main Street
birth_date: 1992-02-02
city: Berkeley
country: USA
created_time: 2023-03-14 00:45:00+00:00
email: john.doe@company.com
first_name: John
gender: M
identifications:
- type: SSN
value: '4444'
last_modified_time: 2023-03-14 00:45:00+00:00
last_name: Doe
metadata:
key1: value1
key2: value2
password: my-password
phone: '15105551212'
postal_code: '94702'
state: CA
status: ACTIVE
token: my_user_02
uses_parent_account: false
end_index: 1
is_more: false
start_index: 0
schema:
$ref: '#/components/schemas/UserCardHolderListResponse'
description: Success
'400':
content: {}
description: Bad request
'500':
content: {}
description: Server error
summary: List users
tags:
- Users
post:
description: 'This endpoint enables you to create a user.
A new user''s initial status depends on the <</core-api/kyc-verification, Know Your Customer (KYC) requirements>> of the program or associated <</core-api/account-holder-groups, account holder group>>.
[cols="1,1,1,1"]
|===
| KYC Required | Initial User Status | User Active on Creation | User Limitations
| Always
| `UNVERIFIED`
| Optional
| Cannot load funds; cannot activate cards.
| Conditionally
| `LIMITED`
| Optional
| Restricted by rules in `accountholdergroups.pre_kyc_controls`.
| Never
| `ACTIVE`
| Required
| None.
|===
[NOTE]
Use the `/usertransitions` endpoints to transition user resources between statuses and to view the history of a user''s status.
Do not set the value of the `user.active` field directly.
For more information on status changes, see <</core-api/user-transitions#postUsertransitions, Create User Transition>>.
To perform KYC verification on users, the user object must have the following fields configured:
* `first_name` (legal first name only, no prefixes)
* `last_name` (legal last name only, no suffixes)
* `address1` (cannot be a PO Box)
* `city`
* `state`
* `postal_code`
* `country`
* `birth_date`
* `identifications`
* `phone` (required in some cases)
* `email` (required in some cases)
[NOTE]
The `identifications` requirement depends on your program''s configuration.
To determine if you should provide a full or abbreviated identification number, contact your Marqeta representative.
KYC verification requires the full Social Security Number (SSN) or Individual Taxpayer Identification Number (ITIN) of the user.
To create a child user, you must identify the parent user or business and determine whether the child user shares an account with the parent.
The parent must be an existing user or business.
On the child user, set the `parent_token` field to the value of the parent''s `token` field.
If either the parent or the grandparent is a business, a `business_token` field is added to the user.
This field''s value is set to the token of either the parent or grandparent (whichever is the business).
The `uses_parent_account` field determines whether the child shares balances with the parent (`true`) or whether the child balances are independent of the parent (`false`).
If you do not specify a value for `uses_parent_account`, it is set to `false` by default (the user does not share the parent''s balance) and returned in the response body.
This field cannot be updated, so you must decide upon creation whether the child user shares the parent balance.
Sharing an account with a parent user affects how the child user interacts with cards as follows:
* A child user cannot spend funds if its parent is not active.
* An active child user can activate cards, whether the parent is active or not.'
operationId: postUsers
requestBody:
content:
application/json:
example:
address1: 1234 Grove Street
birth_date: 1991-01-01
birth_place: US
city: Berkeley
country: USA
email: jane.doe@company.com
first_name: Jane
gender: F
identifications:
- type: SSN
value: '111234444'
last_name: Doe
metadata:
authentication_answer1: Cashier
authentication_answer2: Trabant
authentication_answer3: Blue
authentication_question1: What was your first job?
authentication_question2: What make was your first car?
authentication_question3: What is your favorite color?
notification_email: jane.doe@home.com
notification_language: spa
password: P@ssw0rd
phone: '15105551212'
postal_code: '94702'
state: CA
title: Chief Comptroller
token: my_user_01
uses_parent_account: false
schema:
$ref: '#/components/schemas/card_holder_model'
required: false
responses:
'201':
content:
application/json:
example:
account_holder_group_token: DEFAULT_AHG
active: true
address1: 1234 Grove Street
birth_date: 1991-01-01
birth_place: US
city: Berkeley
corporate_card_holder: false
country: USA
created_time: 2023-03-26 20:21:24+00:00
email: jane.doe6@company.com
first_name: Jane
gender: F
last_modified_time: 2023-03-26 20:21:24+00:00
last_name: Doe
metadata:
authentication_answer1: Cashier
authentication_answer2: Trabant
authentication_answer3: Blue
authentication_question1: What was your first job?
authentication_question2: What make was your first car?
authentication_question3: What is your favorite color?
notification_email: jane.doe@home.com
notification_language: spa
password: P@ssw0rd
phone: '15105551212'
ssn: '5555'
state: CA
status: ACTIVE
title: Chief Comptroller
token: my_user_01
uses_parent_account: false
zip: '94702'
schema:
$ref: '#/components/schemas/user_card_holder_response'
description: Success
'400':
content: {}
description: User input error/Bad request
'409':
content: {}
description: Request already processed with a different payload
'412':
content: {}
description: Pre-condition setup issue
'500':
content: {}
description: Server error
summary: Create user
tags:
- Users
/users/auth/changepassword:
post:
description: 'To change a user password, send a `POST` request to the `/users/auth/changepassword` endpoint and include the `current_password` and `new_password` in link:http://www.json.org/[JSON, window="_blank"] format in the body of the request.
This endpoint operates in the context of a currently logged-in user.
A successful password change returns an empty response body with a response code of `204 No Content`.'
operationId: postUsersAuthChangepassword
requestBody:
content:
application/json:
example:
current_password: my_old_password
new_password: my_new_password
schema:
$ref: '#/components/schemas/password_update_model'
description: Password update object
required: true
responses:
'204':
content: {}
description: Success
'400':
content: {}
description: User input error/Bad request
'401':
content: {}
description: Unauthorized
'500':
content: {}
description: Server error
summary: Update user password
tags:
- Users
/users/auth/clientaccesstoken:
post:
description: 'Each time you want to display a virtual card''s sensitive data (for example, when using `marqeta.js`), you must first request a new, single-use client access token from the Marqeta platform by sending a `POST` request to the `/users/auth/clientaccesstoken` endpoint.
Unredeemed client access tokens expire after five minutes.'
operationId: postUsersAuthClientaccesstoken
requestBody:
content:
application/json:
example:
card_token: my_card_01
schema:
$ref: '#/components/schemas/client_access_token_request'
required: false
responses:
'201':
content:
application/json:
example:
created: 2022-07-29 12:00:00+00:00
expires: 2022-07-29 12:05:00+00:00
token: ewogICJ0b2tlbiI6ICI5NzIwMDkwNS00ODc0LTRkMWEtODEzMS1jMWI3NDAwNzJjM2MmYXBwbGljYXRpb25fdG9rZW49eW91cl9hcHBsaWNhdGlvbl90b2tlbiIsCiAgImFwcGxpY2F0aW9uIjogewogICAgInRva2VuIjogInlvdXJfYXBwbGljYXRpb25fdG9rZW4iLAogICAgImFjdGl2ZSI6IHRydWUsCiAgICAiY2xpZW50X2FwaV9iYXNlX3VybCI6ICJodHRwOi8vd2lkZ2V0cy1lbnYubWFycWV0YS5jb20vY2xpZW50L2FwaS92MSIsCiAgICAiYXNzZXRzX3VybCI6ICJodHRwOi8vd2lkZ2V0cy1lbnYubWFycWV0YS5jb20vY2xpZW50L2Fzc2V0cy8xLjAuMCIsCiAgICAiY2xpZW50dG9rZW5hcHBsaWNhdGlvbklkIjogIjU3MDI2OTJhMGI4ZGNlOTg1YWVmNTExMiIKICB9LAogICJhcHBsaWNhdGlvbl90b2tlbiI6IG51bGwsCiAgImV4cGlyZXMiOiAiMjAxOC0xMi0zMVQyMzo1OTo1OSswMDAwIiwKICAiY2FyZF90b2tlbiI6ICJ0b2tlbl9vZl90aGVfY2FyZF95b3VfbmVlZF90b19wcmVzZW50IiwKICAiYWNjZXNzZWQiOiBudWxsLAogICJjbGllbnR0b2tlbklkIjogIjU5MTc2Y2JlMGI4ZGNlOTg1YWVmNTEzMCIsCiAgImNyZWF0ZWQiOiAiMjAxOC0wMS0wMVQwMDowMDowMCswMDAwIgp9
schema:
$ref: '#/components/schemas/client_access_token_response'
description: Created
'400':
content: {}
description: User input error/Bad request
'401':
content: {}
description: Unauthorized
'500':
content: {}
description: Server error
summary: Create client access token
tags:
- Users
/users/auth/clientaccesstoken/{token}:
get:
description: To retrieve application and card information using a client access token, send a `GET` request to the `/users/auth/clientaccesstoken/{token}` endpoint.
operationId: getUsersAuthClientaccesstokenToken
parameters:
- description: Client access token.
explode: false
in: path
name: token
required: true
schema:
type: string
style: simple
- description: Unique identifier of the `application` object.
explode: true
in: query
name: application_token
required: false
schema:
type: string
style: form
responses:
'200':
content:
application/json:
example:
created: 2022-07-29 12:00:00+00:00
expires: 2022-07-29 12:05:00+00:00
token: ewogICJ0b2tlbiI6ICI5NzIwMDkwNS00ODc0LTRkMWEtODEzMS1jMWI3NDAwNzJjM2MmYXBwbGljYXRpb25fdG9rZW49eW91cl9hcHBsaWNhdGlvbl90b2tlbiIsCiAgImFwcGxpY2F0aW9uIjogewogICAgInRva2VuIjogInlvdXJfYXBwbGljYXRpb25fdG9rZW4iLAogICAgImFjdGl2ZSI6IHRydWUsCiAgICAiY2xpZW50X2FwaV9iYXNlX3VybCI6ICJodHRwOi8vd2lkZ2V0cy1lbnYubWFycWV0YS5jb20vY2xpZW50L2FwaS92MSIsCiAgICAiYXNzZXRzX3VybCI6ICJodHRwOi8vd2lkZ2V0cy1lbnYubWFycWV0YS5jb20vY2xpZW50L2Fzc2V0cy8xLjAuMCIsCiAgICAiY2xpZW50dG9rZW5hcHBsaWNhdGlvbklkIjogIjU3MDI2OTJhMGI4ZGNlOTg1YWVmNTExMiIKICB9LAogICJhcHBsaWNhdGlvbl90b2tlbiI6IG51bGwsCiAgImV4cGlyZXMiOiAiMjAxOC0xMi0zMVQyMzo1OTo1OSswMDAwIiwKICAiY2FyZF90b2tlbiI6ICJ0b2tlbl9vZl90aGVfY2FyZF95b3VfbmVlZF90b19wcmVzZW50IiwKICAiYWNjZXNzZWQiOiBudWxsLAogICJjbGllbnR0b2tlbklkIjogIjU5MTc2Y2JlMGI4ZGNlOTg1YWVmNTEzMCIsCiAgImNyZWF0ZWQiOiAiMjAxOC0wMS0wMVQwMDowMDowMCswMDAwIgp9
schema:
$ref: '#/components/schemas/client_access_token_response'
description: Success
'400':
content: {}
description: Bad request
'401':
content: {}
description: Unauthorized
'403':
content: {}
description: Forbidden
'500':
content: {}
description: Server error
summary: Retrieve client access token
tags:
- Users
/users/auth/login:
post:
description: 'To log in a user and return a user access token, send a `POST` request to the `/users/auth/login` endpoint and include the user details in link:http://www.json.org/[JSON, window="_blank"] format in the body of the request.
[TIP]
To check a user''s credentials without logging out the user, call the `/users/auth/onetime` endpoint.'
operationId: postUsersAuthLogin
requestBody:
content:
application/json:
example:
email: jane.doe@company.com
password: P@ssw0rd
user_token: my_user_01
schema:
$ref: '#/components/schemas/login_request_model'
description: User login object
required: false
responses:
'204':
content:
application/json:
example:
access_token:
expires: 2027-03-01 21:02:04+00:00
one_time: false
token: e12b1f64-1444-4aa3-83d9-347800c68e94
user:
active: true
created_time: 2023-04-01 17:52:39+00:00
email: jane.doe@company.com
last_modified_time: 2023-04-01 17:52:39+00:00
password: P@ssw0rd
token: my_user_01
uses_parent_account: false
schema:
$ref: '#/components/schemas/login_response_model'
description: Success
'400':
content: {}
description: User input error/Bad request
'401':
content: {}
description: Unauthorized
'500':
content: {}
description: Server error
summary: Log in user
tags:
- Users
/users/auth/logout:
post:
description: 'To log out a user, send a `POST` request to the `/users/auth/logout` endpoint.
A successful logout returns an empty response body with a response code of `204 No Content`.'
operationId: postUsersAuthLogout
responses:
'204':
content: {}
description: Success
'400':
content: {}
description: User input error/Bad request
'401':
content: {}
description: Unauthorized
'500':
content: {}
description: Server error
summary: Log out user
tags:
- Users
/users/auth/onetime:
post:
description: 'This endpoint returns a single-use access token.
This type of token authorizes a single request to access API endpoints and data associated with a particular user.
A single-use access token differs from a user access token (as returned by `POST` `/users/auth/login`) only in the number of times it can be used.
To return a single-use access token, send a `POST` request to the `/users/auth/onetime` endpoint.
Provide one of these sets of input data:
* *Case #1* – Application token and user access token
* *Case #2* – Application token, admin access token, and user token
* *Case #3* – Application token, user''s Marqeta password, and user''s email address
In each case, provide the application token as the HTTP Basic Authentication username in the request header''s Authorization field.
When applicable, provide the user access token or admin access token as the HTTP Basic Authentication password.
When applicable, provide the user token or user''s Marqeta password and email address in link:http://www.json.org/[JSON, window="_blank"] format in the request body.
Before instantiating an embedded Marqeta widget, call this endpoint to obtain the single-use access token required as input (cases #1 and #2).
This endpoint is also useful when you want to check a user''s credentials before performing a sensitive operation without having to log out the user (case #3).
[NOTE]
Calling this endpoint and returning a single-use access token does not invalidate the user''s current user access token.'
operationId: postUsersAuthOnetime
requestBody:
content:
application/json:
examples:
case_one:
summary: '*Case 1:* Authorization: Basic `my_application_token:my_user_access_token`'
value: {}
case_three:
summary: '*Case 3:* Authorization: Basic `my_application_token`'
value:
email: jane.doe@company.com
password: P@ssw0rd
case_two:
summary: '*Case 2:* Authorization: Basic `my_application_token:my_admin_access_token`'
value:
user_token: my_user_token
schema:
$ref: '#/components/schemas/one_time_request_model'
description: One-time object
required: false
responses:
'201':
content:
application/json:
example:
expires: 2024-04-01 00:00:00+00:00
one_time: true
token: 697e0bde-ea52-44bd-8150-0e0f83e9625d
schema:
$ref: '#/components/schemas/access_token_response'
description: Created
'400':
content: {}
description: User input error/Bad request
'401':
content: {}
description: Unauthorized
'500':
content: {}
description: Server error
summary: Create single-use token
tags:
- Users
/users/auth/resetpassword:
post:
description: 'Use this endpoint to generate a password reset token for a user.
Send a `POST` request to the `/users/auth/resetpassword` endpoint and include the user''s email address in link:http://www.json.org/[JSON, window="_blank"] format in the body of the request.
This request generates and sends an email message containing the `user_token` and `password_reset_token` to the user''s email address.
You must customize the email message with a link that passes the `user_token` and `password_reset_token` to a web page where a subsequent request updates the password.
A successful request returns an empty response body with a response code of `204 No Content`.'
operationId: postUsersAuthResetpassword
requestBody:
content:
application/json:
example:
email: jane.doe@company.com
schema:
$ref: '#/components/schemas/reset_user_password_email_model'
required: false
responses:
'204':
content: {}
description: Success
'400':
content: {}
description: User input error/Bad request
'401':
content: {}
description: Unauthorized
'500':
content: {}
description: Server error
summary: Request user password reset token
tags:
- Users
/users/auth/resetpassword/{token}:
post:
description: 'To reset the user''s password, send a `POST` request to the `/users/auth/resetpassword/{token}` endpoint that includes a password reset token generated using the `POST /users/auth/resetpassword` operation.
Include the `user_token` and `new_password` in link:http://www.json.org/[JSON, window="_blank"] format in the body of the request.
Include the `password_reset_token` as a path parameter.
A successful password reset returns an empty response body with a response code of `204 No Content`.'
operationId: postUsersAuthResetpasswordToken
parameters:
- description: Password reset token generated using the `POST /users/auth/resetpassword` operation.
explode: false
in: path
name: token
required: true
schema:
type: string
style: simple
requestBody:
content:
application/json:
example:
new_password: newPassword123@
user_token: my_user_01
schema:
$ref: '#/components/schemas/reset_user_password_model'
required: false
responses:
'204':
content: {}
description: Success
'400':
content: {}
description: User input error/Bad request
'401':
content: {}
description: Unauthorized
'500':
content: {}
description: Server error
summary: Reset user password
tags:
- Users
/users/auth/verifyemail:
post:
description: 'Send a `POST` request to the `/users/auth/verifyemail` endpoint to request an email verification token.
No input parameters are required because this operation is performed in the context of an authenticated user.
This initial request generates and sends an email message containing the email verification token to the cardholder''s email address.
This email message must include a link that passes the email verification token to a web page where a subsequent request verifies the email address.
A successful request returns an empty response body with a response code of `204 No Content`.'
operationId: postUsersAuthVerifyemail
responses:
'204':
content: {}
description: Success
'400':
content: {}
description: User input error/Bad request
'401':
content: {}
description: Unauthorized
'500':
content: {}
description: Server error
summary: Request email verification token
tags:
- Users
/users/auth/verifyemail/{token}:
post:
description: 'To verify a user''s email address, send a `POST` request to the `/users/auth/verifyemail/{email_verification_token}` endpoint that includes an `email_verification_token` generated using the `POST /users/auth/verifyemail` operation.
Include the `email_verification_token` as a path parameter.
A successful email verification returns an empty response body with a response code of `204 No Content`.'
operationId: postUsersAuthVerifyemailToken
parameters:
- description: Email verification token generated using the `POST /users/auth/verifyemail` operation.
explode: false
in: path
name: token
required: true
schema:
type: string
style: simple
responses:
'204':
content: {}
description: Success
'400':
content: {}
description: User input error/Bad request
'401':
content: {}
description: Unauthorized
'500':
content: {}
description: Server error
summary: Verify email address
tags:
- Users
/users/lookup:
post:
description: 'To search for one or more users, send a `POST` request to the `/users/lookup` endpoint.
Include in the message body any parameters by which you want to query.
This endpoint supports <</core-api/field-filtering, field filtering>> and <</core-api/sorting-and-pagination, pagination>>.'
operationId: postUsersLookup
parameters:
- description: Number of user resources to retrieve.
explode: true
in: query
name: count
required: false
schema:
default: 5
format: int32
type: integer
style: form
- description: Sort order index of the first resource in the returned array.
explode: true
in: query
name: start_index
required: false
schema:
default: 0
format: int32
type: integer
style: form
- description: Search type.
explode: true
in: query
name: search_type
required: false
schema:
type: string
style: form
- description: 'Comma-delimited list of fields to return (`field_1,field_2`, and so on).
Leave blank to return all fields.'
explode: true
in: query
name: fields
required: false
schema:
type: string
style: form
- description: 'Field on which to sort.
Use any field in the resource model, or one of the system fields `lastModifiedTime` or `createdTime`.
Prefix the field name with a hyphen (`-`) to sort in descending order.
Omit the hyphen to sort in ascending order.'
explode: true
in: query
na
# --- truncated at 32 KB (94 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/marqeta/refs/heads/main/openapi/marqeta-users-api-openapi.yml