Skip to main content
GET
/
v1
/
members
/
{id}
cURL
curl --request GET \
  --url https://api.onsi.com/v1/members/{id} \
  --header 'x-api-key: <api-key>'
import requests

url = "https://api.onsi.com/v1/members/{id}"

headers = {"x-api-key": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};

fetch('https://api.onsi.com/v1/members/{id}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.onsi.com/v1/members/{id}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "x-api-key: <api-key>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.onsi.com/v1/members/{id}"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-api-key", "<api-key>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.onsi.com/v1/members/{id}")
  .header("x-api-key", "<api-key>")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.onsi.com/v1/members/{id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "email": "jsmith@example.com",
  "memberId": "mem_q5sdae3se6eg9m9dcvug",
  "firstName": "John",
  "lastName": "Smith",
  "phone": "+447123456789",
  "tier": "Gold",
  "workerId": "ID_123",
  "accountDetails": {
    "accountHolder": "John Smith",
    "sortCode": "123456",
    "accountNumber": "12345678"
  },
  "enablePayroll": true,
  "dob": "1990-01-01"
}
This API returns a single member given their Onsi provided member_id.

Authorizations

x-api-key
string
header
required

Path Parameters

id
string
required

The unique identifier for a Member, prefixed with mem_

Example:

"mem_<id>"

Response

200 - application/json

A member on the platform.

A member on the platform.

email
string<email>
required
Pattern: ^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$
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
BankAccountUK · object
required

A UK bank account

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

true

dob
string | null
required

Date of birth of the member, must later than 1900

Pattern: ^\d{4}-\d{2}-\d{2}$
Example:

"1990-01-01"

gender
enum<string> | null

Gender of the member

Available options:
Female,
Male,
NonBinary