DOCS

New!

/

25 minute read

August 3, 2019

Users

The users resource represents a person who uses a Marqeta card (physical or virtual) to access Marqeta-administered funds. 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 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.

Create user

Action: POST
Endpoint: /users

Get started now!

Sign up today and get access to Marqeta's API Explorer

This endpoint enables you to create a user. A new user’s initial status depends on the Know Your Customer (KYC) requirements of the program or associated account holder group.

KYC Required Initial User Status User Active on Creation User Limitations

Always

UNVERIFIED

No

Can’t load funds; can’t activate cards.

Conditionally

LIMITED

No

Restricted by rules in accountholdergroups.pre_kyc_controls.

Never

ACTIVE

Yes

None.

To change or track the history of a user’s status, use the /usertransitions endpoint. For more information on status changes, see Create User Transition on this page.

To perform KYC verification checks on users, the user object must have the following fields configured:

  • first_name

  • last_name

  • address1 (cannot be a PO Box)

  • city

  • state

  • postal_code

  • country

  • birth_date

  • identifications

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.

To create a child user, you must identify the parent user or business and decide 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 parent’s parent 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.

Body field details

Fields Description

token

string, optional

The unique identifier of the user. If you do not include a token, the system generates one automatically. This token is necessary for use in other API calls, so we recommend that rather than let the system generate one, you use a simple string that is easy to remember. This value cannot be updated.

Allowable Values:

36 char max

honorific

string, optional

The user’s title/prefix: Ms., Mr., Miss, Mrs.

Allowable Values:

10 char max

gender

string, optional

The gender of the user.

Allowable Values:

M, F

email

string, optional

A valid email address for the user.

This value must be unique among users.

Allowable Values:

255 char max

address1

string, optional

The address of the user.

Required for verification (KYC) checks. Cannot perform KYC if set to a PO Box.

Allowable Values:

255 char max

address2

string, optional

Additional address information for the user.

Cannot perform KYC if set to a PO Box.

Allowable Values:

255 char max

city

string, optional

The city that corresponds to the address.

Required for verification (KYC) checks.

Allowable Values:

40 char max

state

string, optional

The state that corresponds to the address.

Required for verification (KYC) checks.

Allowable Values:

2 char max

postal_code

string, optional

Postal code.

Required for verification (KYC) checks.

Allowable Values:

10 char max

country

string, optional

Country in which user resides.

Required for verification (KYC) checks.

Allowable Values:

40 char max

metadata

object, optional

Associates customer-injected metadata with the user.

Allowable Values:

nationality

string, optional

Nationality of the user.

Allowable Values:

255 char max

notes

string, optional

Any additional information pertaining to the user.

Allowable Values:

255 char max

phone

string, optional

10-digit phone number of the user.

Allowable Values:

510-555-1212 or 5105551212

Do not insert a 1 before the area code.

middle_name

string, optional

User’s middle name.

Allowable Values:

40 char max

first_name

string, optional

User’s first name.

Required for verification (KYC) checks.

Allowable Values:

40 char max

birth_date

string, optional

The date of birth of the user.

Required for verification (KYC) checks.

Allowable Values:

yyyy-MM-dd

last_name

string, optional

User’s last name.

Required for verification (KYC) checks.

Allowable Values:

40 char max

uses_parent_account

boolean, optional

Indicates whether the child shares balances with the parent (true), or whether the child balances are independent of the parent (false).

If set to true, must also include a parent_token in the request. This value cannot be updated.

Allowable Values:

true, false;

Default value: false

parent_token

string, optional

The unique identifier of a user/business already in the system.

Required if uses_parent_account = true. This user/business is configured as the parent of the current user.

Allowable Values:

Existing user or business token.

Send a GET request to /users to retrieve user tokens or /businesses to retrieve business tokens.

password

string, optional

Password for user account.

Allowable Values:

  • 8-20 characters

  • must contain at least 1 numeral

  • must contain at least 1 lower-case letter

  • must contain at least 1 upper-case letter

  • must contain at least 1 of these symbols: @#$%!^&*()\_+~`-=[]{},;:'",./<>?

corporate_card_holder

boolean, optional

Set to true if user holds a corporate card.

Allowable Values:

true, false;

Default value: false

company

string, optional

Company name.

Allowable Values:

255 char max

ip_address

string, optional

The IP address of the user.

Allowable Values:

45 char max

account_holder_group_token

string, optional

Associates the specified account holder group with the user.

Allowable Values:

Existing account holder group token.

Send a GET request to /accountholdergroups to retrieve account holder group tokens.

identifications

array, optional

One or more objects containing identifying information about the user.

Allowable Values:

The identifications array

You can add one or more objects to the identifications array. Each identification in the array must be of a different type.

Only one of the following identification types can be associated with a user:

  • SSN – Social Security Number

  • SIN – Social Insurance Number

  • TIN – Taxpayer Identification Number

  • NIN – National Insurance Number

You can also include the following identification types:

  • PASSPORT_NUMBER – Passport number

  • DRIVERS_LICENSE – Driver’s license number

Fields Description

type

string, required

The form of identification.

Note
SSN is required for KYC verification checks.

Allowable Values:

SSN, TIN, SIN, NIN, PASSPORT_NUMBER, DRIVERS_LICENSE

value

string, required

The identification number associated with the form of identification.

Allowable Values:

255 char max

expiration_date

string, optional

The expiration date for the form of identification, if applicable.

Allowable Values:

yyyy-MM-dd

The metadata object

Fields Description

*customer_defined_name_01*

string, optional

Associates customer-injected metadata with the user. The Marqeta customer defines the names and values of up to 20 fields, for example:

"metadata": {
  "my_name_1": "my_value_1",
  "my_name_2": "my_value_2"
}

Allowable Values:

  • Up to 20 name-value pairs

  • 255 char max per name

  • 255 char max per value.

Sample request body

{
  "first_name": "Blue",
  "last_name": "Bird",
  "token": "bluebird_token",
  "email": "bluebird@gmail.com",
  "password": "My_passw0rd",
  "identifications": [
    {
      "type": "SSN",
      "value": "4444"
    }
  ],
  "birth_date": "1991-01-01",
  "address1": "1234 Blake Street",
  "city": "Berkeley",
  "state": "CA",
  "country": "USA",
  "postal_code": "94702",
  "phone": "5101111111",
  "gender": "M",
  "uses_parent_account": false,
  "corporate_card_holder": false,
  "metadata": {
    	"key1":"value1",
    	"key2":"value2"
  }
}

Is this helpful?

Sample response body

{
     "token": "bluebird_token",
     "active": true,
     "gender": "M",
     "first_name": "Blue",
     "last_name": "Bird",
     "email": "bluebird@gmail.com",
     "address1": "1234 Blake Street",
     "city": "Berkeley",
     "state": "CA",
     "postal_code": "94702",
     "country": "USA",
     "phone": "5101111111",
     "uses_parent_account": false,
     "corporate_card_holder": false,
     "password": "___________",
     "created_time": "2018-08-16T19:39:34Z",
     "last_modified_time": "2018-08-16T19:39:34Z",
     "metadata": {
         "key1": "value1",
         "key2": "value2"
     },
     "account_holder_group_token": "DEFAULT_AHG",
     "status": "ACTIVE",
     "identifications": [
         {
             "type": "SSN",
             "value": "___________"
         }
     ],
     "deposit_account": {
         "token": "30835506-8629-4367-8afc-221f0efc0541",
         "account_number": "00003504793049766",
         "routing_number": "293748000",
         "allow_immediate_credit": false
     },
     "birth_date": "1991-01-01"
 }

Is this helpful?

Retrieve user

Action: GET
Endpoint: /users/{token}

Get started now!

Sign up today and get access to Marqeta's API Explorer

To retrieve a specific user, send a GET request to the /users/{token} endpoint. Include the user token path parameter to specify the user to return.

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:

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 the parent’s parent is a business.

This endpoint supports field filtering.

URL path parameters

Fields Description

token

string, required

The token identifying the user you wish to retrieve.

Allowable Values:

Existing user token.

Send a GET request to /users to retrieve existing user tokens.

Sample response body

{
     "token": "bluebird_token",
     "active": true,
     "gender": "M",
     "first_name": "Blue",
     "last_name": "Bird",
     "email": "bluebird@gmail.com",
     "address1": "1234 Blake Street",
     "city": "Berkeley",
     "state": "CA",
     "postal_code": "94702",
     "country": "USA",
     "phone": "5101111111",
     "uses_parent_account": false,
     "corporate_card_holder": false,
     "password": "___________",
     "created_time": "2018-08-16T19:39:34Z",
     "last_modified_time": "2018-08-16T19:39:34Z",
     "metadata": {
         "key1": "value1",
         "key2": "value2"
     },
     "account_holder_group_token": "DEFAULT_AHG",
     "status": "ACTIVE",
     "identifications": [
         {
             "type": "SSN",
             "value": "___________"
         }
     ],
     "birth_date": "1991-01-01"
 }

Is this helpful?

Update user

Action: PUT
Endpoint: /users/{token}

Get started now!

Sign up today and get access to Marqeta's API Explorer

URL path parameters

Fields Description

token

string, required

The token identifying the user to update.

Allowable Values:

Existing user token. Issue GET to /users to retrieve an existing user token.

Body field details

Fields Description

honorific

string, optional

The user’s title/prefix: Ms., Mr., Miss, Mrs.

Allowable Values:

10 char max

gender

string, optional

The gender of the user.

Allowable Values:

M, F

email

string, optional

A valid email address for the user.

This value must be unique among users.

Allowable Values:

255 char max

address1

string, optional

The address of the user.

Required for verification (KYC) checks. Cannot perform KYC if set to a PO Box.

Allowable Values:

255 char max

address2

string, optional

Additional address information for the user.

Cannot perform KYC if set to a PO Box.

Allowable Values:

255 char max

city

string, optional

The city that corresponds to the address.

Required for verification (KYC) checks.

Allowable Values:

40 char max

state

string, optional

The state that corresponds to the address.

Required for verification (KYC) checks.

Allowable Values:

2 char max

postal_code

string, optional

Postal code.

Required for verification (KYC) checks.

Allowable Values:

10 char max

country

string, optional

Country in which user resides.

Required for verification (KYC) checks.

Allowable Values:

40 char max

metadata

object, optional

Associates customer-injected metadata with the user.

Allowable Values:

nationality

string, optional

Nationality of the user.

Allowable Values:

255 char max

notes

string, optional

Any additional information pertaining to the user.

Allowable Values:

255 char max

phone

string, optional

10-digit phone number of the user.

Allowable Values:

510-555-1212 or 5105551212

Do not insert a "1" before the area code.

middle_name

string, optional

User’s middle name.

Allowable Values:

40 char max

first_name

string, optional

User’s first name.

Required for verification (KYC) checks.

Allowable Values:

40 char max

last_name

string, optional

User’s last name.

Required for verification (KYC) checks.

Allowable Values:

40 char max

birth_date

string, optional

The date of birth of the user.

Required for verification (KYC) checks.

Allowable Values:

yyyy-MM-dd

parent_token

string, optional

The unique identifier of a user already in the system.

Required if uses_parent_account = true. This user is configured as the parent of the current user.

Allowable Values:

Existing user token

ip_address

string, optional

The IP address of the user.

Allowable Values:

45 char max

corporate_card_holder

boolean, optional

Set to true if corporate card.

Allowable Values:

true, false

Default value: false

company

string, optional

Company name.

Allowable Values:

255 char max

account_holder_group_token

string, optional

Associates the specified account holder group with the user.

Allowable Values:

Existing account holder group token.

Send a GET request to /accountholdergroups to retrieve account holder group tokens.

identifications

array, optional

One or more objects containing identifying information about the user.

Allowable Values:

The identifications array

You can add one or more objects to the identifications array. Each identification in the array must be of a different type.

Only one of the following identification types can be associated with a user:

  • SSN – Social Security Number

  • SIN – Social Insurance Number

  • TIN – Taxpayer Identification Number

  • NIN – National Insurance Number

You can also include the following identification types:

  • PASSPORT_NUMBER – Passport number

  • DRIVERS_LICENSE – Driver’s license number

Fields Description

type

string, required

The form of identification.

Note
SSN is required for KYC verification checks.

Allowable Values:

SSN, TIN, SIN, NIN, PASSPORT_NUMBER, DRIVERS_LICENSE

value

string, required

The identification number associated with the form of identification.

Allowable Values:

255 char max

expiration_date

string, optional

The expiration date for the form of identification, if applicable.

Allowable Values:

yyyy-MM-dd

The metadata object

Fields Description

*customer_defined_name_01*

string, optional

Associates customer-injected metadata with the user. The Marqeta customer defines the names and values of up to 20 fields, for example:

"metadata": {
  "my_name_1": "my_value_1",
  "my_name_2": "my_value_2"
}

The following samples show how to update, add, and delete fields. Existing fields are unaffected unless they are included in the request.

Update a field’s value:

"metadata": {
  "my_name_1": "my_updated_value"
}

Add a new field:

"metadata": {
  "my_new_field": "my_value"
}

Delete an existing field:

"metadata": {
  "my_name_1": null
}

Allowable Values:

  • Up to 20 name-value pairs

  • 255 char max per name

  • 255 char max per value

Sample request body

{
  "metadata": {
    	"key2": null
  }
}

Is this helpful?

Sample response body

{
     "token": "bluebird_token",
     "active": true,
     "gender": "M",
     "first_name": "Blue",
     "last_name": "Bird",
     "email": "bluebird@gmail.com",
     "address1": "1234 Blake Street",
     "city": "Berkeley",
     "state": "CA",
     "postal_code": "94702",
     "country": "USA",
     "phone": "5101111111",
     "uses_parent_account": false,
     "corporate_card_holder": false,
     "password": "___________",
     "created_time": "2018-08-16T19:39:34Z",
     "last_modified_time": "2018-08-16T19:39:34Z",
     "metadata": {
         "key1": "value1"
     },
     "account_holder_group_token": "DEFAULT_AHG",
     "status": "ACTIVE",
     "identifications": [
         {
             "type": "SSN",
             "value": "___________"
         }
     ],
     "birth_date": "1991-01-01"
 }

Is this helpful?

List users

Action: GET
Endpoint: /users

Get started now!

Sign up today and get access to Marqeta's API Explorer

To return an array of all users, send a GET request to the /users endpoint. This endpoint supports field filtering and pagination. To narrow your result set to users that match certain criteria, see the 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:

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 the parent’s parent is a business.

Sample response body

{
     "count": 2,
     "start_index": 0,
     "end_index": 1,
     "is_more": false,
     "data": [
         {
             "token": "bluebird_token_2",
             "active": true,
             "gender": "M",
             "first_name": "Blue",
             "last_name": "Bird",
             "email": "bluebird2@gmail.com",
             "address1": "1234 Blake Street",
             "city": "Berkeley",
             "state": "CA",
             "postal_code": "94702",
             "country": "USA",
             "phone": "5101111111",
             "uses_parent_account": false,
             "corporate_card_holder": false,
             "password": "___________",
             "created_time": "2018-08-16T19:43:02Z",
             "last_modified_time": "2018-08-16T19:43:02Z",
             "metadata": {
                 "key1": "value1",
                 "key2": "value2"
             },
             "account_holder_group_token": "DEFAULT_AHG",
             "status": "ACTIVE",
             "identifications": [
                 {
                     "type": "SSN",
                     "value": "___________"
                 }
             ],
             "birth_date": "1991-01-01"
         },
         {
             "token": "bluebird_token",
             "active": true,
             "gender": "M",
             "first_name": "Blue",
             "last_name": "Bird",
             "email": "bluebird@gmail.com",
             "address1": "1234 Blake Street",
             "city": "Berkeley",
             "state": "CA",
             "postal_code": "94702",
             "country": "USA",
             "phone": "5101111111",
             "uses_parent_account": false,
             "corporate_card_holder": false,
             "password": "___________",
             "created_time": "2018-08-16T19:39:34Z",
             "last_modified_time": "2018-08-16T19:39:34Z",
             "metadata": {
                 "key1": "value1",
                 "key2": "value2"
             },
             "account_holder_group_token": "DEFAULT_AHG",
             "status": "ACTIVE",
             "identifications": [
                 {
                     "type": "SSN",
                     "value": "___________"
                 }
             ],
             "birth_date": "1991-01-01"
         }
     ]
 }

Is this helpful?

Search users

Action: POST
Endpoint: /users/lookup

Get started now!

Sign up today and get access to Marqeta's API Explorer

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 field filtering and pagination.

Body field details

Fields Description

first_name

string, optional

Performs a non-case-sensitive match on the users' first_name field. Matching is partial on the beginning of the name. For example, a match on "Alex" returns both "Alex" and "Alexander".

Allowable Values:

40 char max

last_name

string, optional

Performs a non-case-sensitive match on the users' last_name field. Matching is partial on the beginning of the name. For example, a match on "Smith" returns both "Smith" and "Smithline".

Allowable Values:

40 char max

phone

string, optional

Performs a match on the users' phone field.

Allowable Values:

A valid and complete user telephone number

email

string, optional

Performs a non-case-sensitive, exact match on the users' email field.

Allowable Values:

A valid and complete user email address

ssn

string, optional

Performs a match on the users' identification number.

Allowable Values:

Either a complete identification number or the last four digits.

Numerals only; do not use hyphens.

dda

string, optional

Performs a match on the specified deposit account number.

Allowable Values:

Existing deposit account number

Send a GET request to /directdeposits/accounts/{user_token} to retrieve the deposit account number for a specific user.

Send a GET request to /users to retrieve user tokens.

Sample request body

{
  "first_name" : "John"
}

Is this helpful?

Sample response body

{
     "count": 1,
     "start_index": 0,
     "end_index": 1,
     "is_more": false,
     "data": [
         {
             "token": "7fef2cd2-4f7b-4ca8-a89d-eccadfaf28fb",
             "active": true,
             "gender": "M",
             "first_name": "John",
             "last_name": "Smith",
             "email": "john32@gmail.com",
             "address1": "123 Main Street",
             "city": "Oakland",
             "state": "CA",
             "postal_code": "94601",
             "country": "USA",
             "phone": "5101111111",
             "uses_parent_account": false,
             "corporate_card_holder": false,
             "password": "___________",
             "created_time": "2018-08-16T20:26:28Z",
             "last_modified_time": "2018-08-16T20:26:29Z",
             "metadata": {},
             "account_holder_group_token": "DEFAULT_AHG",
             "status": "ACTIVE",
             "identifications": [
                 {
                     "type": "DRIVERS_LICENSE",
                     "value": "12345"
                 }
             ],
             "birth_date": "1986-04-01"
         }
     ]
 }

Is this helpful?

List user children

Action: GET
Endpoint: /users/{parent_token}/children

Get started now!

Sign up today and get access to Marqeta's API Explorer

To retrieve users who are children of another user or of a business (the parent), send a GET request to the /users/{parent_token}/children endpoint. Include the parent’s user/business token as a URL path parameter.

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:

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 the parent’s parent is a business.

This endpoint supports field filtering.

URL path parameters

Fields Description

parent_token

string, required

The token of the parent user/business.

Allowable Values:

Existing user/business token.

Send a GET request to /users to retrieve user tokens or to /businesses to retrieve business tokens.

Sample response body

{
     "count": 1,
     "start_index": 0,
     "end_index": 0,
     "is_more": false,
     "data": [
         {
             "token": "child_of_parent",
             "active": true,
             "gender": "M",
             "first_name": "John",
             "last_name": "Smith",
             "email": "john_smith@gmail.com",
             "address1": "123 Main Street",
             "city": "Oakland",
             "state": "CA",
             "postal_code": "94601",
             "country": "USA",
             "phone": "5101111111",
             "parent_token": "bluebird_token",
             "uses_parent_account": true,
             "corporate_card_holder": false,
             "password": "___________",
             "created_time": "2018-08-16T19:46:58Z",
             "last_modified_time": "2018-08-16T19:46:58Z",
             "metadata": {},
             "account_holder_group_token": "DEFAULT_AHG",
             "status": "ACTIVE",
             "identifications": [
                 {
                     "type": "SSN",
                     "value": "___________"
                 }
             ],
             "birth_date": "1986-04-01"
         }
     ]
 }

Is this helpful?

Verify user email address

Verifying a user’s email address is a two-step process. First you request an email verification token, and then you use that token in a subsequent request to verify the email.

Step one

Action: POST
Endpoint: /users/auth/verifyemail

Get started now!

Sign up today and get access to Marqeta's API Explorer

To request an email verification token, send a POST to the /users/auth/verifyemail endpoint. (No input parameters are required because this operation is performed in the context of an authenticated user.) This request generates and sends an email message containing the email verification token to the user’s email address. (The email message must be customized with a link that passes the email verification token to a web page where a subsequent request verifies the email address.) You set up the subsequent request in Step two.

A successful request returns an empty response body and a response code of 204 No Content.

Step two

Action: POST
Endpoint: /users/auth/verifyemail/{email_verification_token}

Get started now!

Sign up today and get access to Marqeta's API Explorer

To verify the email address, send a POST request to the /users/auth/verifyemail/{email_verification_token} endpoint. Include email_verification_token as a path parameter.

A successful email verification returns an empty response body and a response code of 204 No Content.

URL path parameters

Fields Description

email_verification_token

string, required

Email verification token.

Allowable Values:

Generated from POST /users/auth/verifyemail

Retrieve user identification number

Action: GET
Endpoint: /users/{token}/ssn

Get started now!

Sign up today and get access to Marqeta's API Explorer

To retrieve the government-issued identification number for a user, send a GET request to the /users/{token}/ssn endpoint. Include the token path parameter to specify the user whose identification number (SSN, TIN, NIN, SIN) you wish to return. You can indicate whether to return the full number or the last four digits only.

URL path parameters

Fields Description

token

string, required

Identifies the user whose identification number you want to retrieve.

Allowable Values:

Existing user token.

Send a GET request to /users to retrieve user tokens.

Query parameters

Fields Description

full_ssn

boolean, required

To return the full identification number, set to true.
To return only the last 4 digits, set to false.

If the identifications array contains only the last four digits of the identification number, the /users/{token}/ssn endpoint will return only the last four digits regardless of the full_ssn parameter.

Allowable Values:

true, false

Default value: false

Sample response body

{
  "ssn": "5555"
}

Is this helpful?

Change password

Action: POST
Endpoint: /users/auth/changepassword

Get started now!

Sign up today and get access to Marqeta's API Explorer

To change a user password, send a POST request to the /users/auth/changepassword endpoint and include the current_password and new_password in JSON format in the body of the request. This endpoint operates in the context of a currently logged-in user.

A successful change of password returns an empty response body and a response code of "204 No Content".

Body field details

Fields Description

new_password

string, required

The new password.

Allowable Values:

40 char max

current_password

string, required

The current password.

Allowable Values:

40 char max

Sample request body

{
  "new_password": "my_new_password",
  "current_password": "my_old_password"
}

Is this helpful?

Reset user password

Resetting a user’s password is a two-step process. First you request a password reset token, and then you use that token in a subsequent request to update the password.

Step one

Action: POST
Endpoint: /users/auth/resetpassword

Get started now!

Sign up today and get access to Marqeta's API Explorer

To request a reset password token, send a POST request to the /users/auth/resetpassword endpoint and include the user’s email address in JSON 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. (The email message must be customized with a link that passes the user_token and password_reset_token to a web page where a subsequent request updates the password.) You set up the subsequent request in Step 2.

A successful request returns an empty response body and a response code of "204 No Content".

Body field details

Fields Description

email

string, required

Email address of the user.

Allowable Values:

255 char max

Sample request body

{
  "email": "my_email@gmail.com"
}

Is this helpful?

Step two

Action: POST
Endpoint: /users/auth/resetpassword/{password_reset_token}

Get started now!

Sign up today and get access to Marqeta's API Explorer

To reset the password, send a POST request to the /users/auth/resetpassword/{password_reset_token} endpoint. Include the user_token and new_password in JSON format in the body of the request. Include the password_reset_token as a path parameter.

A successful reset of password returns an empty response body and a response code of "204 No Content".

URL path parameters

Fields Description

password_reset_token

string, required

Password reset token.

Allowable Values:

Generated from POST /users/auth/resetpassword

Body field details

Fields Description

user_token

string, required

The token identifying the user whose password is reset.

Allowable Values:

255 char max

new_password

string, required

New password.

Allowable Values:

255 char max

Sample request body

{
  "user_token": "my_user",
  "new_password": "newPassword123@"
}

Is this helpful?

Log out user

Action: POST
Endpoint: /users/auth/logout

Get started now!

Sign up today and get access to Marqeta's API Explorer

To log out a user, send a POST request to the /users/auth/logout endpoint.

A successful logout returns an empty response body and a response code of "204 No Content".

Log in user

Action: POST
Endpoint: /users/auth/login

Get started now!

Sign up today and get access to Marqeta's API Explorer

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 JSON format in the body of the request.

Note
To check a user’s credentials without logging out the user, utilize the /users/auth/onetime endpoint.

Body field details

Fields Description

email

string, required

The user’s email address.

Allowable Values:

255 char max

password

string, required

The user’s Marqeta password.

Allowable Values:

255 char max

user_token

string, required

Identifies the user to log in.

Allowable Values:

Existing user token.

Send a GET request to /users to retrieve user tokens.

Sample request body

{
  "email": "bigbird@gmail.com",
  "password": "My_passw0rd",
  "user_token": "bigbird_token"
}

Is this helpful?

Sample response body

{
 "access_token" : {
   "token" : "e12b1f64-1444-4aa3-83d9-347800c68e94",
   "expires" : "2016-04-01T21:02:04Z",
   "one_time" : false
 },
 "user" : {
   "token" : "bigbird_token",
   "active" : true,
   "email" : "bigbird@gmail.com",
   "uses_parent_account" : false,
   "password" : "___________",
   "corporate_card_holder" : false,
   "created_time" : "2016-04-01T17:52:39Z",
   "last_modified_time" : "2016-04-01T17:52:39Z"
 }
}

Is this helpful?

Return single-use token

Action: POST
Endpoint: /users/auth/onetime

Get started now!

Sign up today and get access to Marqeta's API Explorer

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, master 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 master access token as the HTTP Basic Authentication password. When applicable, provide the user token or user’s Marqeta password and email address in JSON 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 that calling this endpoint and returning a single-use access token does not invalidate the user’s current user access token.

Body field details

Fields Description

user_token

string, optional

Identifies the user whose data is accessed.

Allowable Values:

Existing user token.

Send a GET request to /users to retrieve user tokens.

email

string, optional

User’s email address.

Allowable Values:

255 char max

password

string, optional

User’s Marqeta password.

Allowable Values:

255 char max

Sample request body

Case #1 – Authorization: Basic my_application_token:my_user_access_token

{
}

Is this helpful?

Case #2 – Authorization: Basic my_application_token:my_master_access_token

{
  "user_token": "my_user_token"
}

Is this helpful?

Case #3 – Authorization: Basic my_application_token

{
  "email": "bruninho@gmail.com",
  "password": "Querty123$"
}

Is this helpful?

Sample response body

{
    "token" : "697e0bde-ea52-44bd-8150-0e0f83e9625d",
    "expires" : "2015-06-13T01:06:14Z",
    "one_time" : true
}

Is this helpful?

Create user transition

Action: POST
Endpoint: /usertransitions

Get started now!

Sign up today and get access to Marqeta's API Explorer

This endpoint enables you to change a user’s status, depending on your role and the previous status change. By changing a user’s status, you can control the user’s capabilities and the setting of the user.active field. (You cannot control user.active directly.)

The user.status Field Description The user.active Field User Limitations Allowable Transitions

Unverified

Initial status of a new user belonging to an accountholdergroup where KYC is always required.

false

Can’t load funds or activate cards.

ACTIVE, SUSPENDED, CLOSED

Limited

Initial status of a new user belonging to an accountholdergroup where KYC is conditionally required.

true

Restricted by rules in accountholdergroups.pre_kyc_controls.

ACTIVE, SUSPENDED, CLOSED

Active

Status of a user who has passed KYC, or initial status of a new user belonging to an accountholdergroup where KYC is never required.

true

None.

SUSPENDED, CLOSED

Suspended

The user is temporarily inactive.

Note
Transitioning a suspended user to the Active status is restricted based on your role and the details of the previous status change.

false

Can’t load funds or activate cards.

ACTIVE, LIMITED, UNVERIFIED, CLOSED

Closed

The user is permanently inactive.

Note
In general, the Closed status should be terminal. For exceptional cases, you can transition a user to other statuses, depending on your role and the details of the previous status change. Contact your Marqeta representative for more information.

false

Can’t load funds or activate cards.

ACTIVE, LIMITED, UNVERIFIED , SUSPENDED

Note
The Marqeta platform transitions a user’s status in response to certain events. For example, a user in the "Unverified" status is transitioned to "Active" when the user passes KYC.

Body field details

Fields Description

token

string, optional

The unique identifier of the user transition.

If you do not include a token, the system generates one automatically. This token is referenced in other API calls, so we recommend that you define a simple string that is easy to remember. This value cannot be updated.

Allowable Values:

36 char max

user_token

string, required

Identifies the user whose status is transitioned.

Allowable Values:

Existing user token.

Send a GET request to the /users endpoint to obtain a user token.

status

string, required

Specifies the new status of the user.

Allowable Values:

UNVERIFIED, LIMITED, ACTIVE, SUSPENDED, CLOSED

reason_code

string, required

Identifies the standardized reason for the transition.

Allowable Values:

See The reason_code Field section.

reason

string, optional

Additional information about the status change.

Allowable Values:

255 char max

channel

string, required

The mechanism by which the transaction was initiated.

Allowable Values:

API, IVR, FRAUD, ADMIN, SYSTEM

The reason_code field

Value Description

00

Object activated for the first time.

01

Requested by you.

02

Inactivity over time.

03

Provided address either does not accept mail or the addressee is not known at the address.

04

Negative account balance.

05

Account under review.

06

Suspicious activity was identified.

07

Activity outside the program parameters was identified.

08

Confirmed fraud was identified.

09

Matched with an Office of Foreign Assets Control list.

10

Card was reported lost or stolen.

11

Card information was cloned.

12

Account or card information was compromised.

13

Temporary status change while on hold/leave.

14

Initiated by Marqeta.

15

Initiated by issuer.

16

Card expired.

17

Failed KYC.

18

Changed to ACTIVE because information was properly validated and confirmed.

19

Changed to ACTIVE because account activity was properly validated and confirmed.

20

Change occurred prior to the normalization of reason codes.

21

Initiated by a third-party, often a digital wallet provider.

Sample request body

{
  "token": "activate_05",
  "user_token": "my_user_01",
  "status": "ACTIVE",
  "reason_code": "00",
  "reason": "Activating user",
  "channel": "API"
}

Is this helpful?

Sample response body

{
  "token": "activate_05",
  "user_token": "my_user_01",
  "status": "ACTIVE",
  "reason_code": "00",
  "reason": "Activating user",
  "channel": "API",
  "created_time": "2016-11-23T23:28:39Z"
}

Is this helpful?

Retrieve user transition

Action: GET
Endpoint: /usertransitions/{token}

Get started now!

Sign up today and get access to Marqeta's API Explorer

Use this endpoint to retrieve a user transition.

URL path parameters

Fields Description

token

string, required

Identifies the user transition to retrieve.

Allowable Values:

Existing user transition token.

Sample response body

{
  "token": "activate_05",
  "user_token": "my_user_01",
  "status" : "ACTIVE",
  "reason_code": "00",
  "reason": "Activating user",
  "channel": "API",
  "created_time": "2016-11-23T23:28:39Z"
}

Is this helpful?

List transitions for user

Action: GET
Endpoint: /usertransitions/user/{token}

Get started now!

Sign up today and get access to Marqeta's API Explorer

Use this endpoint to list all transitions for a given user.

URL path parameters

Fields Description

token

string, required

Identifies the user associated with the transitions to retrieve.

Allowable Values:

Existing user token.

Sample response body

{
  "count": 1,
  "start_index": 0,
  "end_index": 0,
  "is_more": false,
  "data": [
    {
      "token": "activate_05",
      "user_token": "my_user_01",
      "status": "ACTIVE",
      "reason_code": "00",
      "reason": "Activating user",
      "channel": "API",
      "created_time": "2016-11-23T23:28:39Z"
    }
  ]
}

Is this helpful?

Have any feedback on this page?

If you feel we can do anything better, please let our team know.

We strive for the best possible developer experience.