Segments
Your segments, newest first, with their status and size. GET /segments/{segmentId} returns a segment’s criteria.
Your Goodfit API key, sent as the bare header value
Rows per page, 1 to 1000
100Opaque cursor from a previous response. Omit for the first page
List segments
Pass as iterator to fetch the next page. Null on the last page
Bad request
Unauthorized
Forbidden
Too many requests
Internal server error
GET /dataset/segments HTTP/1.1
Host: api.goodfit.io
Authorization: YOUR_API_KEY
Accept: */*
{
"segments": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text",
"isDynamic": true,
"status": "NEW",
"sizeCompanies": 1,
"sizeContacts": 1,
"lastRefreshedAt": null,
"createdAt": "text",
"updatedAt": "text"
}
],
"totalSegments": 1,
"nextIterator": null,
"hasMoreResults": true
}Saves a segment and starts calculating its companies, which runs in the background: the segment comes back UPDATING, so poll GET /segments/{segmentId} until it is READY. Spends no credits.
Your Goodfit API key, sent as the bare header value
Companies left out whatever the filters say
[]Unique among your segments
Refresh after every dataset sync
falseSaved; calculating
Bad request
Unauthorized
The account has reached its segment limit
A live segment already has this name
Too many requests
Internal server error
POST /dataset/segments HTTP/1.1
Host: api.goodfit.io
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 250
{
"filters": {
"id": "root",
"combinator": "and",
"rules": [
{
"id": "r1",
"field": "__match_sourcing_criteria",
"operator": "booleanTrue"
}
]
},
"excludeDomains": [
"text"
],
"companyLimit": {
"max": 1,
"orderBy": "text",
"orderDirection": "ASC"
},
"name": "text",
"isDynamic": false
}{
"segment": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text",
"isDynamic": true,
"status": "NEW",
"sizeCompanies": 1,
"sizeContacts": 1,
"lastRefreshedAt": null,
"createdAt": "text",
"updatedAt": "text",
"filters": null,
"excludeDomains": [
"text"
],
"companyLimit": {
"max": 1,
"orderBy": "text",
"orderDirection": "ASC"
}
}
}One segment: its criteria, status and size. Poll this after a change until status is READY.
Your Goodfit API key, sent as the bare header value
The segment id
Get a segment
Bad request
Unauthorized
Forbidden
No segment with this id exists for your account
Too many requests
Internal server error
GET /dataset/segments/{segmentId} HTTP/1.1
Host: api.goodfit.io
Authorization: YOUR_API_KEY
Accept: */*
{
"segment": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text",
"isDynamic": true,
"status": "NEW",
"sizeCompanies": 1,
"sizeContacts": 1,
"lastRefreshedAt": null,
"createdAt": "text",
"updatedAt": "text",
"filters": null,
"excludeDomains": [
"text"
],
"companyLimit": {
"max": 1,
"orderBy": "text",
"orderDirection": "ASC"
}
}
}Deletes the segment and, in the background, removes its companies and contacts from it. The contacts stay granted to your account and keep appearing in GET /contacts.
Your Goodfit API key, sent as the bare header value
The segment id
Deleted; no body
No content
Bad request
Unauthorized
Forbidden
No segment with this id exists for your account
The segment is updating or refreshing
Too many requests
Internal server error
DELETE /dataset/segments/{segmentId} HTTP/1.1
Host: api.goodfit.io
Authorization: YOUR_API_KEY
Accept: */*
No content
Changes only the fields sent. New criteria recalculate the companies in the background (202): poll GET /segments/{segmentId} until it is READY. A name or isDynamic change alone saves straight away (200). A dynamic segment with personas searches for contacts after every dataset sync, spending contact credits.
Your Goodfit API key, sent as the bare header value
The segment id
A dynamic segment refreshes after every dataset sync
Update a segment
Bad request
Unauthorized
Forbidden
No segment with this id exists for your account
The segment is updating or refreshing, or another live segment has this name
Too many requests
Internal server error
PATCH /dataset/segments/{segmentId} HTTP/1.1
Host: api.goodfit.io
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 249
{
"name": "text",
"isDynamic": true,
"filters": {
"id": "root",
"combinator": "and",
"rules": [
{
"id": "r1",
"field": "__match_sourcing_criteria",
"operator": "booleanTrue"
}
]
},
"excludeDomains": [
"text"
],
"companyLimit": {
"max": 1,
"orderBy": "text",
"orderDirection": "ASC"
}
}{
"segment": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text",
"isDynamic": true,
"status": "NEW",
"sizeCompanies": 1,
"sizeContacts": 1,
"lastRefreshedAt": null,
"createdAt": "text",
"updatedAt": "text",
"filters": null,
"excludeDomains": [
"text"
],
"companyLimit": {
"max": 1,
"orderBy": "text",
"orderDirection": "ASC"
}
}
}How many companies a segment with these criteria would hold, without saving it. sample returns up to that many of those companies too.
Your Goodfit API key, sent as the bare header value
Companies left out whatever the filters say
[]Companies to return, 0 to 50
0Preview a segment
Bad request
Unauthorized
Forbidden
Too many requests
Internal server error
POST /dataset/segments/preview HTTP/1.1
Host: api.goodfit.io
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 229
{
"filters": {
"id": "root",
"combinator": "and",
"rules": [
{
"id": "r1",
"field": "__match_sourcing_criteria",
"operator": "booleanTrue"
}
]
},
"excludeDomains": [
"text"
],
"companyLimit": {
"max": 1,
"orderBy": "text",
"orderDirection": "ASC"
},
"sample": 0
}{
"sizeCompanies": 1,
"companies": [
{
"ANY_ADDITIONAL_PROPERTY": "anything"
}
]
}Recalculates the companies and searches again for contacts for each persona on the segment, in the background (202): poll GET /segments/{segmentId} until it is READY. Each contact newly granted to your account costs one contact credit. A segment never calculated, or whose last calculation failed, is recalculated instead, which spends nothing.
Your Goodfit API key, sent as the bare header value
The segment id
Refreshing
Bad request
Unauthorized
Forbidden
No segment with this id exists for your account
The segment is already updating or refreshing
Too many requests
Internal server error
POST /dataset/segments/{segmentId}/refresh HTTP/1.1
Host: api.goodfit.io
Authorization: YOUR_API_KEY
Accept: */*
{
"segment": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text",
"isDynamic": true,
"status": "NEW",
"sizeCompanies": 1,
"sizeContacts": 1,
"lastRefreshedAt": null,
"createdAt": "text",
"updatedAt": "text",
"filters": null,
"excludeDomains": [
"text"
],
"companyLimit": {
"max": 1,
"orderBy": "text",
"orderDirection": "ASC"
}
}
}Last updated