Skip to main content

Documentation Index

Fetch the complete documentation index at: https://support.affinity.co/llms.txt

Use this file to discover all available pages before exploring further.

How-to — task-oriented recipe.
To create an organization in Affinity using the API, check out the API V1 option below. Note: If you’re currently trialing Affinity, you will not be able to access the Affinity API until you purchase one of the following subscription tiers (see the section titled “Who has access to Affinity API V1 and API V2?” within this article: Getting started with the Affinity API + FAQs): Scale, Advanced, or Enterprise.

Creating an organization using API V1

  1. Create a list, or decide which list you would like to add the organization to (done on the web).
  2. Using the API, search for the organization first. Use domain if possible for best results and to prevent duplicates.
    curl "https://api.affinity.co/organizations?term=affinity.co" -u :<API-KEY>
    
  3. Make sure the result is what you are searching for (ex. If you search for “affinity.co”, your result could be affinity.co and affinity.com). If you are able to find the organization, skip to Step 6.
  4. If the search result didn’t find the organization you are looking for, create a new organization with the snippet below.
    curl "https://api.affinity.co/organizations" \
     -u :<API-KEY> \
     -d name="Acme Corporation" \
     -d domain="acme.co"
    
  5. After the organization is created, below is what your response would look liked. You will get the same result if an organization is found as well.
    { "id":120611418, "name": "Acme Corporation", "domain": "acme.co", "crunchbase_uuid": null, "global": false}
    
  6. Take the id, and add it to your list.
    curl "https://api.affinity.co/lists/450/list-entries" \
     -u :<API-KEY> \
     -d entity_id=120611418
    
  7. After adding it to a list, you can use the code below to create field values.
    curl "https://api.affinity.co/field-values" \
     -u :<API-KEY> \
     -d field_id=1284 \
     -d value="Architecture" \
     -d entity_id=120611418
    
Note: You can also use online tools like https://postman.com to convert CURL to Python, JS, or any other language.

Creating an organization using API V2 (not supported at this time)

This functionality is not supported on API V2 at this time. Thank you for your patience and stay tuned for updates later this year.