Create an audience
curl --request POST \
--url https://api.getlurk.com/v1/audiences \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"name": "<string>",
"kind": "list",
"key": "<string>",
"description": "<string>"
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({name: '<string>', kind: 'list', key: '<string>', description: '<string>'})
};
fetch('https://api.getlurk.com/v1/audiences', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.getlurk.com/v1/audiences"
payload = {
"name": "<string>",
"kind": "list",
"key": "<string>",
"description": "<string>"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"key": "<string>",
"name": "<string>",
"description": "<string>",
"kind": "list",
"conditions": [
{
"active": {
"days": 183,
"within_days": 365
}
}
],
"summary": "<string>",
"status": "ok",
"problems": [
{
"condition": 1,
"code": "community_removed",
"message": "<string>"
}
],
"users": 1,
"refreshed_at": "2023-11-07T05:31:56Z",
"used_by": [
{
"type": "rule",
"id": "<string>",
"name": "<string>",
"status": "draft"
}
],
"created_at": "2023-11-07T05:31:56Z",
"unknown": 1
}{
"error": {
"status": 123,
"code": "invalid_json",
"message": "<string>",
"request_id": "<string>",
"doc_url": "<string>",
"param": "<string>",
"next_step": "<string>"
}
}{
"error": {
"status": 123,
"code": "invalid_json",
"message": "<string>",
"request_id": "<string>",
"doc_url": "<string>",
"param": "<string>",
"next_step": "<string>"
}
}{
"error": {
"status": 123,
"code": "invalid_json",
"message": "<string>",
"request_id": "<string>",
"doc_url": "<string>",
"param": "<string>",
"next_step": "<string>"
}
}{
"error": {
"status": 123,
"code": "invalid_json",
"message": "<string>",
"request_id": "<string>",
"doc_url": "<string>",
"param": "<string>",
"next_step": "<string>"
}
}{
"error": {
"status": 123,
"code": "invalid_json",
"message": "<string>",
"request_id": "<string>",
"doc_url": "<string>",
"param": "<string>",
"next_step": "<string>"
}
}Audiences
Create an audience
Makes a list (people you add) or a condition audience (kept up to date by its conditions). A new condition audience starts empty. The worker fills it with people who match. A project can have 100 condition audiences. Rules read it in if. Audiences
POST
/
v1
/
audiences
Create an audience
curl --request POST \
--url https://api.getlurk.com/v1/audiences \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"name": "<string>",
"kind": "list",
"key": "<string>",
"description": "<string>"
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({name: '<string>', kind: 'list', key: '<string>', description: '<string>'})
};
fetch('https://api.getlurk.com/v1/audiences', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.getlurk.com/v1/audiences"
payload = {
"name": "<string>",
"kind": "list",
"key": "<string>",
"description": "<string>"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"key": "<string>",
"name": "<string>",
"description": "<string>",
"kind": "list",
"conditions": [
{
"active": {
"days": 183,
"within_days": 365
}
}
],
"summary": "<string>",
"status": "ok",
"problems": [
{
"condition": 1,
"code": "community_removed",
"message": "<string>"
}
],
"users": 1,
"refreshed_at": "2023-11-07T05:31:56Z",
"used_by": [
{
"type": "rule",
"id": "<string>",
"name": "<string>",
"status": "draft"
}
],
"created_at": "2023-11-07T05:31:56Z",
"unknown": 1
}{
"error": {
"status": 123,
"code": "invalid_json",
"message": "<string>",
"request_id": "<string>",
"doc_url": "<string>",
"param": "<string>",
"next_step": "<string>"
}
}{
"error": {
"status": 123,
"code": "invalid_json",
"message": "<string>",
"request_id": "<string>",
"doc_url": "<string>",
"param": "<string>",
"next_step": "<string>"
}
}{
"error": {
"status": 123,
"code": "invalid_json",
"message": "<string>",
"request_id": "<string>",
"doc_url": "<string>",
"param": "<string>",
"next_step": "<string>"
}
}{
"error": {
"status": 123,
"code": "invalid_json",
"message": "<string>",
"request_id": "<string>",
"doc_url": "<string>",
"param": "<string>",
"next_step": "<string>"
}
}{
"error": {
"status": 123,
"code": "invalid_json",
"message": "<string>",
"request_id": "<string>",
"doc_url": "<string>",
"param": "<string>",
"next_step": "<string>"
}
}Authorizations
Headers
Body
application/json
- Option 1
- Option 2
Response
Create an audience
ok: nothing wrong. broken: a condition names something that is gone, so it can match nobody until it is fixed. not_synced: a chat condition's community has no state yet, so nobody can be in it yet (chat conditions are not available yet)
Available options:
ok, broken, not_synced