List

Preview
GET
https://api.senditly.ai/v1/segments
List segments
This API is in preview. It may be changed in the future.
List segments
cURL
JavaScript
curl -X GET https://api.senditly.ai/v1/segments \
     -H "Authorization: Bearer <API_KEY>" \
     -H "Content-Type: application/json"
try {
  const response = await fetch('https://api.senditly.ai/v1/segments', {
     method: 'GET',
     headers: {
        Authorization: 'Bearer <API_KEY>',
     },
     body: JSON.stringify({ ... request json ... }),
  });
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
Headers
+-Hide 1 propertiesShow 1 properties
Authorization
string
required
Bearer authentication of the form "Bearer <API_KEY>", where API_KEY is your api key.
Query
+-Hide 4 propertiesShow 4 properties
limit
integer
optional
A limit on the number of items to return. Defaults to 10. The value must be between 1 and 100.
startingAfter
string
optional
A cursor to start the list from. Defaults to the first item.
endingBefore
string
optional
A cursor to end the list at. Defaults to the last item.
label
string
optional
Label selector expression.
Response
+-Hide 3 propertiesShow 3 properties
items
object[]
required
+-Hide 6 propertiesShow 6 properties
id
string
required
The id of the segment.
name
string
required
The name of the segment.
labels
{ [key: string]: string }
required
The labels of the segment.
string
ownerId
string
required
The account id for the owner of the segment.
createdAt
string
required
A date string in ISO 8601 format The date and time the segment was created.
updatedAt
string
required
A date string in ISO 8601 format The date and time the segment was last updated.
hasMore
boolean
required
Whether there are more items to fetch.
cursor
string
optional
A cursor to start the next list from.

Count

Preview
GET
https://api.senditly.ai/v1/segments/count
Count segments
This API is in preview. It may be changed in the future.
Count segments
cURL
JavaScript
curl -X GET https://api.senditly.ai/v1/segments/count \
     -H "Authorization: Bearer <API_KEY>" \
     -H "Content-Type: application/json"
try {
  const response = await fetch('https://api.senditly.ai/v1/segments/count', {
     method: 'GET',
     headers: {
        Authorization: 'Bearer <API_KEY>',
     },
     body: JSON.stringify({ ... request json ... }),
  });
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
Headers
+-Hide 1 propertiesShow 1 properties
Authorization
string
required
Bearer authentication of the form "Bearer <API_KEY>", where API_KEY is your api key.
Query
+-Hide 3 propertiesShow 3 properties
after
string
optional
A cursor to start the count from.
before
string
optional
A cursor to end the count at.
label
string
optional
Label selector expression.
Response
+-Hide 1 propertiesShow 1 properties
count
integer
required
The total number of items.

Create

Preview
POST
https://api.senditly.ai/v1/segments
Create a segment
This API is in preview. It may be changed in the future.
Create a segment
cURL
JavaScript
curl -X POST https://api.senditly.ai/v1/segments \
     -H "Authorization: Bearer <API_KEY>" \
     -H "Content-Type: application/json" \
     -d '{ ... request json ... }'
try {
  const response = await fetch('https://api.senditly.ai/v1/segments', {
     method: 'POST',
     headers: {
        Authorization: 'Bearer <API_KEY>',
        'Content-Type': 'application/json',
     },
     body: JSON.stringify({ ... request json ... }),
  });
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
Headers
+-Hide 1 propertiesShow 1 properties
Authorization
string
required
Bearer authentication of the form "Bearer <API_KEY>", where API_KEY is your api key.
Request
+-Hide 2 propertiesShow 2 properties
name
string
optional
The name of the segment.
labels
{ [key: string]: string }
optional
The labels of the segment.
string
Response
A segment.
+-Hide 6 propertiesShow 6 properties
id
string
required
The id of the segment.
name
string
required
The name of the segment.
labels
{ [key: string]: string }
required
The labels of the segment.
string
ownerId
string
required
The account id for the owner of the segment.
createdAt
string
required
A date string in ISO 8601 format The date and time the segment was created.
updatedAt
string
required
A date string in ISO 8601 format The date and time the segment was last updated.

Retrieve

Preview
GET
https://api.senditly.ai/v1/segments/:id
Retrieve a segment
This API is in preview. It may be changed in the future.
Retrieve a segment
cURL
JavaScript
curl -X GET https://api.senditly.ai/v1/segments/:id \
     -H "Authorization: Bearer <API_KEY>" \
     -H "Content-Type: application/json"
try {
  const response = await fetch('https://api.senditly.ai/v1/segments/:id', {
     method: 'GET',
     headers: {
        Authorization: 'Bearer <API_KEY>',
     },
     body: JSON.stringify({ ... request json ... }),
  });
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
Headers
+-Hide 1 propertiesShow 1 properties
Authorization
string
required
Bearer authentication of the form "Bearer <API_KEY>", where API_KEY is your api key.
Parameters
+-Hide 1 propertiesShow 1 properties
id
string
required
The id of the segment.
Response
A segment.
+-Hide 6 propertiesShow 6 properties
id
string
required
The id of the segment.
name
string
required
The name of the segment.
labels
{ [key: string]: string }
required
The labels of the segment.
string
ownerId
string
required
The account id for the owner of the segment.
createdAt
string
required
A date string in ISO 8601 format The date and time the segment was created.
updatedAt
string
required
A date string in ISO 8601 format The date and time the segment was last updated.

Update

Preview
PUT
https://api.senditly.ai/v1/segments/:id
Update a segment
This API is in preview. It may be changed in the future.
Update a segment
cURL
JavaScript
curl -X PUT https://api.senditly.ai/v1/segments/:id \
     -H "Authorization: Bearer <API_KEY>" \
     -H "Content-Type: application/json" \
     -d '{ ... request json ... }'
try {
  const response = await fetch('https://api.senditly.ai/v1/segments/:id', {
     method: 'PUT',
     headers: {
        Authorization: 'Bearer <API_KEY>',
        'Content-Type': 'application/json',
     },
     body: JSON.stringify({ ... request json ... }),
  });
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
Headers
+-Hide 1 propertiesShow 1 properties
Authorization
string
required
Bearer authentication of the form "Bearer <API_KEY>", where API_KEY is your api key.
Parameters
+-Hide 1 propertiesShow 1 properties
id
string
required
The id of the segment.
Request
+-Hide 2 propertiesShow 2 properties
name
string
optional
The name of the segment.
labels
{ [key: string]: string }
optional
The labels of the segment.
string
Response
A segment.
+-Hide 6 propertiesShow 6 properties
id
string
required
The id of the segment.
name
string
required
The name of the segment.
labels
{ [key: string]: string }
required
The labels of the segment.
string
ownerId
string
required
The account id for the owner of the segment.
createdAt
string
required
A date string in ISO 8601 format The date and time the segment was created.
updatedAt
string
required
A date string in ISO 8601 format The date and time the segment was last updated.