For the complete documentation index, see llms.txt. This page is also available as Markdown.

Segments

List segments

get

Your segments, newest first, with their status and size. GET /segments/{segmentId} returns a segment’s criteria.

Required scopes
This endpoint requires the following scopes:
Authorizations
AuthorizationstringRequired

Your Goodfit API key, sent as the bare header value

Query parameters
limitinteger · min: 1 · max: 1000Optional

Rows per page, 1 to 1000

Default: 100
iteratorstring · min: 1Optional

Opaque cursor from a previous response. Omit for the first page

Responses
200

List segments

application/json
totalSegmentsinteger · max: 9007199254740991Required
nextIteratorstring · nullableRequired

Pass as iterator to fetch the next page. Null on the last page

hasMoreResultsbooleanRequired
get/dataset/segments
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
}

Create a segment

post

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.

Required scopes
This endpoint requires the following scopes:
Authorizations
AuthorizationstringRequired

Your Goodfit API key, sent as the bare header value

Body
excludeDomainsstring[] · max: 10000Optional

Companies left out whatever the filters say

Default: []
namestring · min: 1 · max: 255Required

Unique among your segments

isDynamicbooleanOptional

Refresh after every dataset sync

Default: false
Responses
202

Saved; calculating

application/json
post/dataset/segments
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"
    }
  }
}

Get a segment

get

One segment: its criteria, status and size. Poll this after a change until status is READY.

Required scopes
This endpoint requires the following scopes:
Authorizations
AuthorizationstringRequired

Your Goodfit API key, sent as the bare header value

Path parameters
segmentIdstringRequired

The segment id

Responses
200

Get a segment

application/json
get/dataset/segments/{segmentId}
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"
    }
  }
}

Delete a segment

delete

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.

Required scopes
This endpoint requires the following scopes:
Authorizations
AuthorizationstringRequired

Your Goodfit API key, sent as the bare header value

Path parameters
segmentIdstringRequired

The segment id

Responses
204

Deleted; no body

No content

delete/dataset/segments/{segmentId}
DELETE /dataset/segments/{segmentId} HTTP/1.1
Host: api.goodfit.io
Authorization: YOUR_API_KEY
Accept: */*

No content

Update a segment

patch

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.

Required scopes
This endpoint requires the following scopes:
Authorizations
AuthorizationstringRequired

Your Goodfit API key, sent as the bare header value

Path parameters
segmentIdstringRequired

The segment id

Body
namestring · min: 1 · max: 255Optional
isDynamicbooleanOptional

A dynamic segment refreshes after every dataset sync

excludeDomainsstring[] · max: 10000Optional
Responses
200

Update a segment

application/json
patch/dataset/segments/{segmentId}
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"
    }
  }
}

Preview a segment

post

How many companies a segment with these criteria would hold, without saving it. sample returns up to that many of those companies too.

Required scopes
This endpoint requires the following scopes:
Authorizations
AuthorizationstringRequired

Your Goodfit API key, sent as the bare header value

Body
excludeDomainsstring[] · max: 10000Optional

Companies left out whatever the filters say

Default: []
sampleinteger · max: 50Optional

Companies to return, 0 to 50

Default: 0
Responses
200

Preview a segment

application/json
sizeCompaniesinteger · max: 9007199254740991Required
post/dataset/segments/preview
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"
    }
  ]
}

Refresh a segment

post

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.

Required scopes
This endpoint requires the following scopes:
Authorizations
AuthorizationstringRequired

Your Goodfit API key, sent as the bare header value

Path parameters
segmentIdstringRequired

The segment id

Responses
202

Refreshing

application/json
post/dataset/segments/{segmentId}/refresh
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