Submit an AllTrack affiliation for a workspace user
curl --request POST \
--url https://api.royalti.io/writer/by-user/{tenantUserId}/alltrack/affiliation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"firstName": "Ada",
"lastName": "Obi",
"email": "ada.obi@example.com",
"phone": "+2348012345678",
"dateOfBirth": "1995-06-15",
"otherProDeclared": false,
"tosAcceptedAt": "2026-10-01T10:00:00Z",
"address": {
"addressLine1": "12 Marina Road",
"city": "Lagos",
"postalCode": "100001",
"country": "NG",
"addressLine2": null,
"stateOrProvince": "Lagos"
},
"middleName": null,
"stageName": "Ada O",
"taxId": null
}
'import requests
url = "https://api.royalti.io/writer/by-user/{tenantUserId}/alltrack/affiliation"
payload = {
"firstName": "Ada",
"lastName": "Obi",
"email": "ada.obi@example.com",
"phone": "+2348012345678",
"dateOfBirth": "1995-06-15",
"otherProDeclared": False,
"tosAcceptedAt": "2026-10-01T10:00:00Z",
"address": {
"addressLine1": "12 Marina Road",
"city": "Lagos",
"postalCode": "100001",
"country": "NG",
"addressLine2": None,
"stateOrProvince": "Lagos"
},
"middleName": None,
"stageName": "Ada O",
"taxId": None
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
firstName: 'Ada',
lastName: 'Obi',
email: 'ada.obi@example.com',
phone: '+2348012345678',
dateOfBirth: '1995-06-15',
otherProDeclared: false,
tosAcceptedAt: '2026-10-01T10:00:00Z',
address: {
addressLine1: '12 Marina Road',
city: 'Lagos',
postalCode: '100001',
country: 'NG',
addressLine2: null,
stateOrProvince: 'Lagos'
},
middleName: null,
stageName: 'Ada O',
taxId: null
})
};
fetch('https://api.royalti.io/writer/by-user/{tenantUserId}/alltrack/affiliation', 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.royalti.io/writer/by-user/{tenantUserId}/alltrack/affiliation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'firstName' => 'Ada',
'lastName' => 'Obi',
'email' => 'ada.obi@example.com',
'phone' => '+2348012345678',
'dateOfBirth' => '1995-06-15',
'otherProDeclared' => false,
'tosAcceptedAt' => '2026-10-01T10:00:00Z',
'address' => [
'addressLine1' => '12 Marina Road',
'city' => 'Lagos',
'postalCode' => '100001',
'country' => 'NG',
'addressLine2' => null,
'stateOrProvince' => 'Lagos'
],
'middleName' => null,
'stageName' => 'Ada O',
'taxId' => null
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.royalti.io/writer/by-user/{tenantUserId}/alltrack/affiliation"
payload := strings.NewReader("{\n \"firstName\": \"Ada\",\n \"lastName\": \"Obi\",\n \"email\": \"ada.obi@example.com\",\n \"phone\": \"+2348012345678\",\n \"dateOfBirth\": \"1995-06-15\",\n \"otherProDeclared\": false,\n \"tosAcceptedAt\": \"2026-10-01T10:00:00Z\",\n \"address\": {\n \"addressLine1\": \"12 Marina Road\",\n \"city\": \"Lagos\",\n \"postalCode\": \"100001\",\n \"country\": \"NG\",\n \"addressLine2\": null,\n \"stateOrProvince\": \"Lagos\"\n },\n \"middleName\": null,\n \"stageName\": \"Ada O\",\n \"taxId\": null\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.royalti.io/writer/by-user/{tenantUserId}/alltrack/affiliation")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"firstName\": \"Ada\",\n \"lastName\": \"Obi\",\n \"email\": \"ada.obi@example.com\",\n \"phone\": \"+2348012345678\",\n \"dateOfBirth\": \"1995-06-15\",\n \"otherProDeclared\": false,\n \"tosAcceptedAt\": \"2026-10-01T10:00:00Z\",\n \"address\": {\n \"addressLine1\": \"12 Marina Road\",\n \"city\": \"Lagos\",\n \"postalCode\": \"100001\",\n \"country\": \"NG\",\n \"addressLine2\": null,\n \"stateOrProvince\": \"Lagos\"\n },\n \"middleName\": null,\n \"stageName\": \"Ada O\",\n \"taxId\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.royalti.io/writer/by-user/{tenantUserId}/alltrack/affiliation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"firstName\": \"Ada\",\n \"lastName\": \"Obi\",\n \"email\": \"ada.obi@example.com\",\n \"phone\": \"+2348012345678\",\n \"dateOfBirth\": \"1995-06-15\",\n \"otherProDeclared\": false,\n \"tosAcceptedAt\": \"2026-10-01T10:00:00Z\",\n \"address\": {\n \"addressLine1\": \"12 Marina Road\",\n \"city\": \"Lagos\",\n \"postalCode\": \"100001\",\n \"country\": \"NG\",\n \"addressLine2\": null,\n \"stateOrProvince\": \"Lagos\"\n },\n \"middleName\": null,\n \"stageName\": \"Ada O\",\n \"taxId\": null\n}"
response = http.request(request)
puts response.read_body{
"writer": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"firstName": "<string>",
"lastName": "<string>",
"ipiNameNumber": "<string>",
"affiliatedPRO": "<string>"
},
"affiliation": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"writerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "draft",
"ipiNameNumber": "<string>",
"alltrackAccountId": "<string>",
"statusReason": "<string>",
"tosAcceptedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"status": "error",
"code": "AFFILIATION_EXISTS",
"message": "<string>",
"writer": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"firstName": "<string>",
"lastName": "<string>",
"ipiNameNumber": "<string>",
"affiliatedPRO": "<string>"
},
"affiliation": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"writerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "draft",
"ipiNameNumber": "<string>",
"alltrackAccountId": "<string>",
"statusReason": "<string>",
"tosAcceptedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}Writers
Submit an AllTrack affiliation for a workspace user
POST /writer/by-user//alltrack/affiliation
POST
/
writer
/
by-user
/
{tenantUserId}
/
alltrack
/
affiliation
Submit an AllTrack affiliation for a workspace user
curl --request POST \
--url https://api.royalti.io/writer/by-user/{tenantUserId}/alltrack/affiliation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"firstName": "Ada",
"lastName": "Obi",
"email": "ada.obi@example.com",
"phone": "+2348012345678",
"dateOfBirth": "1995-06-15",
"otherProDeclared": false,
"tosAcceptedAt": "2026-10-01T10:00:00Z",
"address": {
"addressLine1": "12 Marina Road",
"city": "Lagos",
"postalCode": "100001",
"country": "NG",
"addressLine2": null,
"stateOrProvince": "Lagos"
},
"middleName": null,
"stageName": "Ada O",
"taxId": null
}
'import requests
url = "https://api.royalti.io/writer/by-user/{tenantUserId}/alltrack/affiliation"
payload = {
"firstName": "Ada",
"lastName": "Obi",
"email": "ada.obi@example.com",
"phone": "+2348012345678",
"dateOfBirth": "1995-06-15",
"otherProDeclared": False,
"tosAcceptedAt": "2026-10-01T10:00:00Z",
"address": {
"addressLine1": "12 Marina Road",
"city": "Lagos",
"postalCode": "100001",
"country": "NG",
"addressLine2": None,
"stateOrProvince": "Lagos"
},
"middleName": None,
"stageName": "Ada O",
"taxId": None
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
firstName: 'Ada',
lastName: 'Obi',
email: 'ada.obi@example.com',
phone: '+2348012345678',
dateOfBirth: '1995-06-15',
otherProDeclared: false,
tosAcceptedAt: '2026-10-01T10:00:00Z',
address: {
addressLine1: '12 Marina Road',
city: 'Lagos',
postalCode: '100001',
country: 'NG',
addressLine2: null,
stateOrProvince: 'Lagos'
},
middleName: null,
stageName: 'Ada O',
taxId: null
})
};
fetch('https://api.royalti.io/writer/by-user/{tenantUserId}/alltrack/affiliation', 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.royalti.io/writer/by-user/{tenantUserId}/alltrack/affiliation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'firstName' => 'Ada',
'lastName' => 'Obi',
'email' => 'ada.obi@example.com',
'phone' => '+2348012345678',
'dateOfBirth' => '1995-06-15',
'otherProDeclared' => false,
'tosAcceptedAt' => '2026-10-01T10:00:00Z',
'address' => [
'addressLine1' => '12 Marina Road',
'city' => 'Lagos',
'postalCode' => '100001',
'country' => 'NG',
'addressLine2' => null,
'stateOrProvince' => 'Lagos'
],
'middleName' => null,
'stageName' => 'Ada O',
'taxId' => null
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.royalti.io/writer/by-user/{tenantUserId}/alltrack/affiliation"
payload := strings.NewReader("{\n \"firstName\": \"Ada\",\n \"lastName\": \"Obi\",\n \"email\": \"ada.obi@example.com\",\n \"phone\": \"+2348012345678\",\n \"dateOfBirth\": \"1995-06-15\",\n \"otherProDeclared\": false,\n \"tosAcceptedAt\": \"2026-10-01T10:00:00Z\",\n \"address\": {\n \"addressLine1\": \"12 Marina Road\",\n \"city\": \"Lagos\",\n \"postalCode\": \"100001\",\n \"country\": \"NG\",\n \"addressLine2\": null,\n \"stateOrProvince\": \"Lagos\"\n },\n \"middleName\": null,\n \"stageName\": \"Ada O\",\n \"taxId\": null\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.royalti.io/writer/by-user/{tenantUserId}/alltrack/affiliation")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"firstName\": \"Ada\",\n \"lastName\": \"Obi\",\n \"email\": \"ada.obi@example.com\",\n \"phone\": \"+2348012345678\",\n \"dateOfBirth\": \"1995-06-15\",\n \"otherProDeclared\": false,\n \"tosAcceptedAt\": \"2026-10-01T10:00:00Z\",\n \"address\": {\n \"addressLine1\": \"12 Marina Road\",\n \"city\": \"Lagos\",\n \"postalCode\": \"100001\",\n \"country\": \"NG\",\n \"addressLine2\": null,\n \"stateOrProvince\": \"Lagos\"\n },\n \"middleName\": null,\n \"stageName\": \"Ada O\",\n \"taxId\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.royalti.io/writer/by-user/{tenantUserId}/alltrack/affiliation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"firstName\": \"Ada\",\n \"lastName\": \"Obi\",\n \"email\": \"ada.obi@example.com\",\n \"phone\": \"+2348012345678\",\n \"dateOfBirth\": \"1995-06-15\",\n \"otherProDeclared\": false,\n \"tosAcceptedAt\": \"2026-10-01T10:00:00Z\",\n \"address\": {\n \"addressLine1\": \"12 Marina Road\",\n \"city\": \"Lagos\",\n \"postalCode\": \"100001\",\n \"country\": \"NG\",\n \"addressLine2\": null,\n \"stateOrProvince\": \"Lagos\"\n },\n \"middleName\": null,\n \"stageName\": \"Ada O\",\n \"taxId\": null\n}"
response = http.request(request)
puts response.read_body{
"writer": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"firstName": "<string>",
"lastName": "<string>",
"ipiNameNumber": "<string>",
"affiliatedPRO": "<string>"
},
"affiliation": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"writerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "draft",
"ipiNameNumber": "<string>",
"alltrackAccountId": "<string>",
"statusReason": "<string>",
"tosAcceptedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}{
"status": "error",
"code": "AFFILIATION_EXISTS",
"message": "<string>",
"writer": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"firstName": "<string>",
"lastName": "<string>",
"ipiNameNumber": "<string>",
"affiliatedPRO": "<string>"
},
"affiliation": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"writerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "draft",
"ipiNameNumber": "<string>",
"alltrackAccountId": "<string>",
"statusReason": "<string>",
"tosAcceptedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}This endpoint requires authentication. Include your Bearer token in the Authorization header.
Description
POST /writer/by-user//alltrack/affiliation Description: Applies for AllTrack affiliation on behalf of one workspace user. Royalti finds the writer linked to the user, or creates one from the legal first and last name in the request (roleCA, worldwide territory), then
submits the application exactly as POST /writer/{id}/alltrack/affiliation
does. The same checks apply: age 13 or over, no other PRO declared, terms
accepted, and one live application per writer.
Returns 201 with the same body as the GET. If the writer already has a
live application, returns 409 with that application in the body.
Limited to 5 requests per user per hour (429, with Retry-After).
Authorization:
- Required role:
adminor higher - API keys: a key scoped to
publishing:affiliationis accepted. These two by-user routes are the only routes that scope reaches. - Requires the
publishercapability enabled with itsalltrackfeature on - Environment kill-switch:
ALLTRACK_AFFILIATION_ENABLED(503 if off)
Code Examples
const response = await fetch('https://api.royalti.io/writer/by-user/example-id/alltrack/affiliation', {
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
"firstName": "Ada",
"middleName": null,
"lastName": "Obi",
"email": "ada.obi@example.com",
"phone": "+2348012345678",
"dateOfBirth": "1995-06-15",
"stageName": "Ada O",
"taxId": null,
"otherProDeclared": false,
"tosAcceptedAt": "2026-10-01T10:00:00Z",
"address": {
"addressLine1": "12 Marina Road",
"addressLine2": null,
"city": "Lagos",
"stateOrProvince": "Lagos",
"postalCode": "100001",
"country": "NG"
}
})
});
const data = await response.json();
console.log(data);
import requests
response = requests.post(
'https://api.royalti.io/writer/by-user/example-id/alltrack/affiliation',
headers={
'Authorization': f'Bearer {token}'
},
json={"firstName":"Ada","middleName":null,"lastName":"Obi","email":"ada.obi@example.com","phone":"+2348012345678","dateOfBirth":"1995-06-15","stageName":"Ada O","taxId":null,"otherProDeclared":false,"tosAcceptedAt":"2026-10-01T10:00:00Z","address":{"addressLine1":"12 Marina Road","addressLine2":null,"city":"Lagos","stateOrProvince":"Lagos","postalCode":"100001","country":"NG"}}
)
data = response.json()
print(data)
curl -X POST https://api.royalti.io/writer/by-user/example-id/alltrack/affiliation \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"firstName":"Ada","middleName":null,"lastName":"Obi","email":"ada.obi@example.com","phone":"+2348012345678","dateOfBirth":"1995-06-15","stageName":"Ada O","taxId":null,"otherProDeclared":false,"tosAcceptedAt":"2026-10-01T10:00:00Z","address":{"addressLine1":"12 Marina Road","addressLine2":null,"city":"Lagos","stateOrProvince":"Lagos","postalCode":"100001","country":"NG"}}'
Authorizations
JWT Authorization header using the Bearer scheme. Format: "Bearer {token}"
Path Parameters
The workspace user (TenantUser) id
Body
application/json
Legal first name. Also used for a new writer.
Maximum string length:
45Example:
"Ada"
Legal last name. Also used for a new writer.
Maximum string length:
45Example:
"Obi"
Example:
"ada.obi@example.com"
Full international number, including the country code
Example:
"+2348012345678"
Example:
"1995-06-15"
Available options:
false Example:
false
Example:
"2026-10-01T10:00:00Z"
Show child attributes
Show child attributes
Maximum string length:
45Example:
null
Example:
"Ada O"
Example:
null