PUT
/
v1
/
members
/
{id}
curl --request PUT \
  --url https://api.onsi.com/v1/members/{id} \
  --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
}

Replacing an existing member, identified by their memberId.

As you’re providing the entire desired member state, members with a status of inactive will be re-activated on your Onsi programme.

Relevant Error Codes

If there are any issues with the member replace, 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

Path Parameters

id
string
required

The unique identifier for a Member, prefixed with mem_

Example:

"mem_<id>"

Body

application/json
Body
email
string
required

A unique email address for the member

Example:

"jane-smith@onsi.com"

firstName
string
required
Example:

"John"

lastName
string
required
Example:

"Smith"

tier
string
required

Tier name for the member

Example:

"Gold"

phone
string

An optional phone number for the member

Example:

"+447123456789"

workerId
string

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

Example:

"ID_123"

accountDetails
object
Example:
{
  "accountHolder": "John Smith",
  "sortCode": "123456",
  "accountNumber": "12345678"
}
enablePayroll
boolean

Response

200 - application/json
200

A member on the platform.

email
string
required
memberId
string
required

Onsi's ID of the member

Example:

"mem_q5sdae3se6eg9m9dcvug"

firstName
string
required
Example:

"John"

lastName
string
required
Example:

"Smith"

phone
string | null
required
Example:

"+447123456789"

tier
string
required

Tier name for the member

Example:

"Gold"

workerId
string | null
required

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

Example:

"ID_123"

status
enum<string>
required

The status of the member.

Available options:
active,
invited,
inactive
accountDetails
object
required
Example:
{
  "accountHolder": "John Smith",
  "sortCode": "123456",
  "accountNumber": "12345678"
}
enablePayroll
boolean
required
Example:

true