{"openapi":"3.1.0","info":{"title":"Affinity (BYOK) API","version":"0.1.0","description":"Affinity (BYOK) lets an AI assistant read your own Affinity data through the Affinity API with a key you supply (Affinity API key (v2)). Read-only: 7 tools (get_current_user, list_persons, list_companies, list_opportunities, list_lists, list_list_entries, list_notes). The BYOK key travels with each request, is used for that one call only and is never stored, logged or cached; it is only ever sent...\n\nEvery operation is read-only or compute-only. The same tools are available over MCP (streamable HTTP) at https://byok-affinity.connectorbay.com/mcp.","contact":{"name":"Unify Dynamics LLC","email":"agent@connectorbay.com","url":"https://connectorbay.com/byok-affinity/docs"},"termsOfService":"https://connectorbay.com/byok-affinity/terms"},"servers":[{"url":"https://byok-affinity.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/byok-affinity/docs"},"security":[{"upstreamKey":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Optional. A Pro API key raises rate limits; no credentials are required."},"upstreamKey":{"type":"apiKey","in":"header","name":"X-Upstream-Key","description":"Your own key for the service this connector wraps (bring your own key). Used for that one call only; never stored, logged or cached."}},"schemas":{"Error":{"type":"object","properties":{"ok":{"const":false},"error":{"type":"object"}}}}},"paths":{"/v1/tools/get_current_user":{"post":{"operationId":"get_current_user","summary":"Show the Affinity user, workspace (tenant) and key type the API key belongs to, with its scopes. Use for \"Which Affinity","description":"Show the Affinity user, workspace (tenant) and key type the API key belongs to, with its scopes. Use for \"Which Affinity workspace and user is my API key for\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{},"title":"get_current_userArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_persons":{"post":{"operationId":"list_persons","summary":"List people in the directory with name, primary email, email addresses and whether they are internal or external. Cursor","description":"List people in the directory with name, primary email, email addresses and whether they are internal or external. Cursor-paged. Needs the 'Export All People directory' permission. Use for \"Who is in our Affinity people directory\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":100,"description":"How many records to return (1 to 100, default 100).","title":"Limit"},"cursor":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}],"default":null,"description":"The cursor query value from pagination.nextUrl of the previous answer; leave empty for the first page.","title":"Cursor"}},"title":"list_personsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_companies":{"post":{"operationId":"list_companies","summary":"List companies (organizations) with name, primary domain and all domains. Cursor-paged. Use for \"Which companies are in ","description":"List companies (organizations) with name, primary domain and all domains. Cursor-paged. Use for \"Which companies are in Affinity\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":100,"description":"How many records to return (1 to 100, default 100).","title":"Limit"},"cursor":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}],"default":null,"description":"The cursor query value from pagination.nextUrl of the previous answer; leave empty for the first page.","title":"Cursor"}},"title":"list_companiesArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_opportunities":{"post":{"operationId":"list_opportunities","summary":"List opportunities (deals) with name and the list they belong to. Cursor-paged. Use for \"What opportunities are tracked ","description":"List opportunities (deals) with name and the list they belong to. Cursor-paged. Use for \"What opportunities are tracked in Affinity\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":100,"description":"How many records to return (1 to 100, default 100).","title":"Limit"},"cursor":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}],"default":null,"description":"The cursor query value from pagination.nextUrl of the previous answer; leave empty for the first page.","title":"Cursor"}},"title":"list_opportunitiesArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_lists":{"post":{"operationId":"list_lists","summary":"List the lists (company, person and opportunity lists) you can view with name, type, owner and visibility. Optionally se","description":"List the lists (company, person and opportunity lists) you can view with name, type, owner and visibility. Optionally search by name; cursor-paged. Use for \"What lists do we have in Affinity\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"term":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null,"description":"Only lists whose name matches this text.","title":"Term"},"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":100,"description":"How many records to return (1 to 100, default 100).","title":"Limit"},"cursor":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}],"default":null,"description":"The cursor query value from pagination.nextUrl of the previous answer; leave empty for the first page.","title":"Cursor"}},"title":"list_listsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_list_entries":{"post":{"operationId":"list_list_entries","summary":"List the entries (rows) of one list with entry type, the person, company or opportunity each row points to, creation tim","description":"List the entries (rows) of one list with entry type, the person, company or opportunity each row points to, creation time and creator. Cursor-paged. Use for \"Which companies are on Affinity list 3\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"list_id":{"description":"Numeric list id from list_lists.","title":"List Id","type":"integer"},"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":100,"description":"How many records to return (1 to 100, default 100).","title":"Limit"},"cursor":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}],"default":null,"description":"The cursor query value from pagination.nextUrl of the previous answer; leave empty for the first page.","title":"Cursor"}},"required":["list_id"],"title":"list_list_entriesArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_notes":{"post":{"operationId":"list_notes","summary":"List notes (text in HTML) with author, creation time, reply count and the type of note. Cursor-paged. Use for \"What note","description":"List notes (text in HTML) with author, creation time, reply count and the type of note. Cursor-paged. Use for \"What notes were written in Affinity recently\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":20,"description":"How many notes to return (1 to 100, default 20).","title":"Limit"},"cursor":{"anyOf":[{"maxLength":1000,"type":"string"},{"type":"null"}],"default":null,"description":"The cursor query value from pagination.nextUrl of the previous answer.","title":"Cursor"}},"title":"list_notesArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}}}}