POST
/
v1
/
members
curl --request POST \
  --url https://api.onsi.com/v1/members \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '{
  "email": "jane-smith@onsi.com",
  "firstName": "John",
  "lastName": "Smith",
  "phone": "+447123456789",
  "workerId": "ID_123",
  "tier": "Gold",
  "accountDetails": {
    "accountHolder": "John Smith",
    "sortCode": "123456",
    "accountNumber": "12345678"
  },
  "enablePayroll": true
}'
{
  "email": "jsmith@example.com",
  "memberId": "mem_q5sdae3se6eg9m9dcvug",
  "firstName": "John",
  "lastName": "Smith",
  "phone": "+447123456789",
  "tier": "Gold",
  "workerId": "ID_123",
  "status": "active",
  "accountDetails": {
    "accountHolder": "John Smith",
    "sortCode": "123456",
    "accountNumber": "12345678"
  },
  "enablePayroll": true
}

This invites a new member to your platform, when they are created they will have the status of invited, if their email already has an associated Onsi account their status will go straight to active.

Relevant Error Codes

If there are any issues with the member add, the API will return a 400 status code with the following error codes:

Authorizations

X-API-KEY
string
header
required

Headers

x-idempotency-key
string

Unique key to ensure idempotency of the request

Body

application/json
Body
email
string
required

A unique email address for the member

firstName
string
required
lastName
string
required
tier
string
required

Tier name for the member

phone
string

An optional phone number for the member

workerId
string

Unique ID provided by API consumer, must be unique across all members (active, invited and inactive)

accountDetails
object
enablePayroll
boolean

Response

201 - application/json
201

A member on the platform.

email
string
required
memberId
string
required

Onsi's ID of the member

firstName
string
required
lastName
string
required
phone
string | null
required
tier
string
required

Tier name for the member

workerId
string | null
required

Unique ID provided by API consumer, must be unique across all members (active, invited and inactive)

status
enum<string>
required

The status of the member.

Available options:
active,
invited,
inactive
accountDetails
object
required
enablePayroll
boolean
required