Users

The users resource represents a person who uses a Marqeta card (physical or virtual) to redeem offers and 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

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 Customer Success 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

Name Type Required? Description Allowable Values
token string No 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. 36 char max
honorific string No The user's title/prefix: Ms., Mr., Miss, Mrs. 10 char max
gender string No The gender of the user. M | F
email string No A valid email address for the user.

This value must be unique among users.
255 char max
address1 string No The address of the user.

Required for verification (KYC) checks. Cannot perform KYC if set to a PO Box.
255 char max
address2 string No Additional address information for the user.

Cannot perform KYC if set to a PO Box.
255 char max
city string No The city that corresponds to the address.

Required for verification (KYC) checks.
40 char max
state string No The state that corresponds to the address.

Required for verification (KYC) checks.
2 char max
postal_code string No Postal code.

Required for verification (KYC) checks.
10 char max
country string No Country in which user resides.

Required for verification (KYC) checks.
40 char max
metadata object No Associates customer-injected metadata with the user.
nationality string No Nationality of the user. 255 char max
notes string No Any additional information pertaining to the user. 255 char max
phone string No 10-digit phone number of the user. 123-456-7890 or 1234567890

Do not insert a 1 before the area code.
middle_name string No User's middle name. 40 char max
first_name string No User's first name.

Required for verification (KYC) checks.
40 char max
birth_date string No The date of birth of the user.

Required for verification (KYC) checks.
yyyy-MM-dd
last_name string No User's last name.

Required for verification (KYC) checks.
40 char max
uses_parent_account boolean No 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.
true | false;

Default: false
parent_token string No 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.
Existing user or business token.

Issue a GET to /users to retrieve user tokens or /businesses to retrieve business tokens.
password string No Password for user account.
  • 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 No Set to true if user holds a corporate card. true | false;

Default: false
company string No Company name. 255 char max
ip_address string No The IP address of the user. 45 char max
account_holder_group_token string No Associates the specified account holder group with the user. Existing account holder group token.

Issue a GET to /accountholdergroups to retrieve account holder group tokens.
identifications array No One or more objects containing identifying information about the user.

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
Name Type Required? Description Allowable Values
type string Yes The form of identification.

Note: SSN is required for KYC verification checks.
SSN | TIN | SIN | NIN | PASSPORT_NUMBER | DRIVERS_LICENSE
value string Yes The identification number associated with the form of identification. 255 char max
expiration_date string No The expiration date for the form of identification, if applicable. yyyy-MM-dd

The metadata object

Name Type Required? Description Allowable Values
customer_defined_name_01
customer_defined_name_02

...

customer_defined_name_20

(255 char max per name)
string No 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"
  }
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"
}
}

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"
}


Retrieve user

Action: GET
Endpoint: /users/{token}

To retrieve a specific user, issue 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

Name Type Required? Description Allowable Values
token string Yes The token identifying the user you wish to retrieve. Existing user token.

Issue a GET 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": "___________"
        }
    ],
    "deposit_account": {
        "token": "30835506-8629-4367-8afc-221f0efc0541",
        "account_number": "00003504793049766",
        "routing_number": "293748000",
        "allow_immediate_credit": false
    },
    "birth_date": "1991-01-01"
}


Update user

Action: PUT
Endpoint: /users/{token}

URL path parameters

Name Type Required? Description Allowable Values
token string Yes The token identifying the user to update. Existing user token. Issue GET to /users to retrieve an existing user token.

Body field details

Name Type Required? Description Allowable Values
honorific string No The user's title/prefix: Ms., Mr., Miss, Mrs. 10 char max
gender string No The gender of the user. M | F
email string No A valid email address for the user.

This value must be unique among users.
255 char max
address1 string No The address of the user.

Required for verification (KYC) checks. Cannot perform KYC if set to a PO Box.
255 char max
address2 string No Additional address information for the user.

Cannot perform KYC if set to a PO Box.
255 char max
city string No The city that corresponds to the address.

Required for verification (KYC) checks.
40 char max
state string No The state that corresponds to the address.

Required for verification (KYC) checks.
2 char max
postal_code string No Postal code.

Required for verification (KYC) checks.
10 char max
country string No Country in which user resides.

Required for verification (KYC) checks.
40 char max
metadata object No Associates customer-injected metadata with the user.
nationality string No Nationality of the user. 255 char max
notes string No Any additional information pertaining to the user. 255 char max
phone string No 10-digit phone number of the user. 123-456-7890 or 1234567890

Do not insert a "1" before the area code.
middle_name string No User's middle name. 40 char max
first_name string No User's first name.

Required for verification (KYC) checks.
40 char max
last_name string No User's last name.

Required for verification (KYC) checks.
40 char max
birth_date string No The date of birth of the user.

Required for verification (KYC) checks.
yyyy-MM-dd
parent_token string No 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.
Existing user token
ip_address string No The IP address of the user. 45 char max
corporate_card_holder boolean No Set to true if corporate card. true | false; Default: false
company string No Company name. 255 char max
account_holder_group_token string No Associates the specified account holder group with the user. Existing account holder group token.

Issue a GET to /accountholdergroups to retrieve account holder group tokens.
identifications array No One or more objects containing identifying information about the user.

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
Name Type Required? Description Allowable Values
type string Yes The form of identification.

Note: SSN is required for KYC verification checks.
SSN | TIN | SIN | NIN | PASSPORT_NUMBER | DRIVERS_LICENSE
value string Yes The identification number associated with the form of identification. 255 char max
expiration_date string No The expiration date for the form of identification, if applicable. yyyy-MM-dd

The metadata object

Name Type Required? Description Allowable Values
customer_defined_name_01
customer_defined_name_02

...

customer_defined_name_20

(255 char max per name)
string No 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
  }

Up to 20 name-value pairs.

255 char max per name; 255 char max per value

Sample request body

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

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": "___________"
        }
    ],
    "deposit_account": {
        "token": "30835506-8629-4367-8afc-221f0efc0541",
        "account_number": "00003504793049766",
        "routing_number": "293748000",
        "allow_immediate_credit": false
    },
    "birth_date": "1991-01-01"
}


List users

Action: GET
Endpoint: /users

To return an array of all users, issue 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"
        }
    ]
}


Search users

Action: POST
Endpoint: /users/lookup

To search for one or more users, issue 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

Name Type Required? Description Allowable Values
first_name string No 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". 40 char max
last_name string No 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". 40 char max
phone string No Performs a match on the users' phone field. A valid and complete user telephone number
email string No Performs a non-case-sensitive, exact match on the users' email field. A valid and complete user email address
ssn string No Performs a match on the users' identification number. Either a complete identification number or the last four digits.

Numerals only; do not use hyphens.
dda string No Performs a match on the specified deposit account number. Existing deposit account number

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

Issue a GET to /users to retrieve user tokens.

Sample request body

{
"first_name" : "John"
}

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"
        }
    ]
}


List user children

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

To retrieve users who are children of another user or of a business (the parent), issue 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

Name Type Required? Description Allowable Values
parent_token string Yes The token of the parent user/business. Existing user/business token.

Issue a GET 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"
        }
    ]
}


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

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 2.

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}

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

Name Type Required? Description Allowable Values
email_verification_token string Yes Email verification token. Generated from POST /users/auth/verifyemail

Retrieve user identification number

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

To retrieve the government-issued identification number for a user, issue 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

Name Type Required? Description Allowable Values
token string Yes Identifies the user whose identification number you want to retrieve. Existing user token.

Issue a GET to /users to retrieve user tokens.

Query parameters

Name Type Required? Description Allowable Values
full_ssn boolean Yes 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.
true | false

Default: false

Sample response body

{
"ssn": "5555"
}


Change password

Action: POST
Endpoint: /users/auth/changepassword

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

Name Type Required? Description Allowable Values
new_password string Yes The new password. 40 char max
current_password string Yes The current password. 40 char max

Sample request body

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


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

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

Name Type Required? Description Allowable Values
email string Yes Email address of the user. 255 char max

Sample request body

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

Step two

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

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

Name Type Required? Description Allowable Values
password_reset_token string Yes Password reset token. Generated from POST /users/auth/resetpassword

Body field details

Name Type Required? Description Allowable Values
user_token string Yes The token identifying the user whose password is reset. 255 char max
new_password string Yes New password. 255 char max

Sample request body

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


Log out user

Action: POST
Endpoint: /users/auth/logout

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

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

Name Type Required? Description Allowable Values
email string Yes The user's email address. 255 char max
password string Yes The user's Marqeta password. 255 char max
user_token string Yes Identifies the user to log in. Existing user token.

Issue a GET to /users to retrieve user tokens.

Sample request body

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

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"
}
}


Return single-use token

Action: POST
Endpoint: /users/auth/onetime

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

Name Type Required? Description Allowable Values
user_token string Required when Basic Authentication password is set to a master access token (case #2). Identifies the user whose data is accessed. Existing user token.

Issue a GET to /users to retrieve user tokens.
email string Required when Basic Authentication password is not specified (case #3). User's email address. 255 char max
password string Required when basic Basic Authentication is not specified (case #3). User's Marqeta password. 255 char max

Sample request body

Case #1 – Authorization: Basic my_application_token:my_user_access_token

{
}

Case #2 – Authorization: Basic my_application_token:my_master_access_token

{
"user_token": "my_user_token"
}

Case #3 – Authorization: Basic my_application_token

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

Sample response body

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


Create user transition

Action: POST
Endpoint: /usertransitions

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 Customer Success 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

Name Type Required? Description Allowable Values
token string No 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.
36 char max
user_token string Yes Identifies the user whose status is transitioned. Existing user token.

Issue a GET request to the /users endpoint to obtain a user token.
status string Yes Specifies the new status of the user. UNVERIFIED | LIMITED | ACTIVE | SUSPENDED | CLOSED
reason_code string Yes Identifies the standardized reason for the transition. See "The reason_code field" section.
reason string No Additional information about the status change. 255 char max
channel string Yes The mechanism by which the transaction was initiated. 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"
}

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"
}


Retrieve user transition

Action: GET
Endpoint: /usertransitions/{token}

Use this endpoint to retrieve a user transition.

URL path parameters

Name Type Required? Description Allowable Values
token string Yes Identifies the user transition to retrieve. 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"
}


List transitions for user

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

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

URL path parameters

Name Type Required? Description Allowable Values
token string Yes Identifies the user associated with the transitions to retrieve. 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"
}
]
}