Bonterra API Endpoints (v1.0)

Download OpenAPI specification:

A Bonterra API Gateway that routes requests to internal Bonterra APIs

Apricot Health Check

Endpoint to check if the Apricot API is up

Responses

Response Schema: text/plain
string (ApricotHealth)

Apricot Users

Get list of users

Retrieves a list of all users in your Apricot instance. Supports pagination, filtering, and sorting.

Common use cases:

  • List all users for administrative purposes
  • Export user directory
  • Find users by name or email using filters
  • Sync user list with external systems
Authorizations:
authorizer-lambdaapi_key
query Parameters
sort
string
Examples:
  • sort=-creation_time - Sort by creation time, newest first
  • sort=name - Sort by name alphabetically

Sort order for results. Prefix with '-' for descending order

object
Example: filter[active]=1&filter[name]=Client

Filter parameters to narrow down results. Use field names as keys

object
Example: page[number]=1&page[size]=25

Pagination parameters for limiting result set size

header Parameters
Authorization
required
string

Header that carries token for request Authorization

Responses

Response Schema: application/json
object (ApricotMeta)

Metadata about the response, including pagination information

Array of objects (ApricotUser)

Array of user objects

Request samples

curl -X GET "https://api.bonterra.network/v1/apricot/users" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response samples

Content type
application/json
{
  • "meta": {
    },
  • "data": [
    ]
}

Create a new user

Creates a new user account in Apricot. Requires username, password, first name, last name, and user type.

Common use cases:

  • Add new team members programmatically
  • Bulk import users from external systems
  • Automated user provisioning

Important notes:

  • Username must be unique (typically an email address)
  • Password must meet complexity requirements
  • User type determines permissions
Authorizations:
authorizer-lambdaapi_key
header Parameters
Authorization
required
string

Header that carries token for request Authorization

Request Body schema:
required
type
required
string

Resource type, must be 'users'

object

User attributes

Responses

Response Schema: application/vnd.api+json
object (ApricotMeta)

Metadata about the response, including pagination information

Array of objects (ApricotUser)

Array of user objects

Request samples

Content type
{
  • "type": "users",
  • "attributes": {
    }
}

Response samples

Content type
application/vnd.api+json
{
  • "meta": {
    },
  • "data": [
    ]
}

Get your own user information

What it does: Retrieves the profile information for the currently authenticated user based on the access token. This is a self-service endpoint that returns details about "you" (the token owner) without needing to know your user ID.

When to use it:

  • Get your own user profile on login
  • Display current user information in UI
  • Verify authentication and user identity
  • Check your own permissions and roles
  • Build "My Profile" or "Account Settings" pages
  • Validate which Apricot instance you're connected to

What you'll need:

  • Valid access token (identifies you automatically)
  • No user ID required - uses token to determine identity

What you'll get back: Your complete user profile including:

  • id - Your unique user ID
  • username - Your login username
  • email - Your email address
  • name_first and name_last - Your full name
  • role - Your role/permissions level
  • active - Whether your account is active
  • programs - Programs you have access to
  • last_login - Your last login timestamp
  • Custom user attributes

Use cases:

  • "Who am I?" - Identity verification after authentication
  • Displaying logged-in user name in application header
  • Checking if you have required permissions before actions
  • Personalizing the user experience based on your profile

vs. GET /users/{id}:

  • This endpoint: Gets YOUR info (token-based, no ID needed)
  • GET /users/{id}: Gets ANY user's info (requires user ID and admin permissions)
Authorizations:
authorizer-lambdaapi_key
header Parameters
Authorization
required
string

Header that carries token for request Authorization

Responses

Response Schema: application/vnd.api+json
id
required
integer <int32>
type
string
Value: "users"
required
object
object (ApricotLinks)

Hypermedia links for navigation and resource discovery

Request samples

curl -X GET "https://api.bonterra.network/v1/apricot/users/info" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response samples

Content type
application/vnd.api+json
{
  • "id": 1,
  • "type": "users",
  • "attributes": {
    },
  • "links": {
    }
}

Get a specific User

Authorizations:
authorizer-lambdaapi_key
path Parameters
id
required
integer <int32>
header Parameters
Authorization
required
string

Header that carries token for request Authorization

Responses

Response Schema: application/vnd.api+json
id
required
integer <int32>
type
string
Value: "users"
required
object
object (ApricotLinks)

Hypermedia links for navigation and resource discovery

Response samples

Content type
application/vnd.api+json
{
  • "id": 1,
  • "type": "users",
  • "attributes": {
    },
  • "links": {
    }
}

Update a user

Authorizations:
authorizer-lambdaapi_key
path Parameters
id
required
integer <int32>
header Parameters
Authorization
required
string

Header that carries token for request Authorization

Request Body schema:
required
type
required
string

Resource type, must be 'users'

object

User attributes

Responses

Response Schema: application/vnd.api+json
id
required
integer <int32>
type
string
Value: "users"
required
object
object (ApricotLinks)

Hypermedia links for navigation and resource discovery

Request samples

Content type
{
  • "type": "users",
  • "attributes": {
    }
}

Response samples

Content type
application/vnd.api+json
{
  • "id": 1,
  • "type": "users",
  • "attributes": {
    },
  • "links": {
    }
}

Get Organizations by Bonterra Auth User ID

Retrieves all Apricot organizations that a Bonterra Auth user is linked to. This endpoint is used for authorization purposes by Account and Impact Hub services.

Purpose:

  • Query linked Apricot users for a given Bonterra Auth user ID
  • Retrieve organization membership and user details
  • Support authorization decisions across services

Personas:

  • Account service (Authorization Code Grant & Client Credentials Grant)
  • Impact Hub service (Authorization Code Grant & Client Credentials Grant)

Important notes:

  • Returns empty array if user has no organizations (still 200 status)
  • Returns 404 only when the Bonterra Auth user ID doesn't exist
  • User can belong to multiple organizations with different roles
Authorizations:
authorizer-lambdaapi_key
path Parameters
bonterra_auth_id
required
string
Example: 37f9a9b0-76ac-4d13-a3b4-8eb9873a24f5

Bonterra Auth ID (GUID, e.g., 37f9a9b0-76ac-4d13-a3b4-8eb9873a24f5)

header Parameters
Authorization
required
string

Header that carries token for request Authorization

Responses

Response Schema: application/json
required
Array of objects (ApricotUserOrganizationMembership)

Array of organization memberships. Each item represents the user's relationship with an organization. Empty array if user has no organizations.

bonterra_auth_id
required
string

The Bonterra Auth user ID

is_super_user
boolean

Indicates if the user is a super user. Only present when the user is a super user.

Response samples

Content type
application/json
Example
{
  • "bonterra_auth_id": "37f9a9b0-76ac-4d13-a3b4-8eb9873a24f5",
  • "orgs": [
    ]
}

Get users who have access to a program

What it does: Retrieves a list of all users who have been granted access to a specific program. This helps you manage program-level permissions and understand who can view/edit data within a program.

When to use it:

  • Audit which users have access to a program
  • Manage program-level user permissions
  • Verify user access before assigning work
  • Build user access reports and matrices
  • Onboard new staff to see team composition
  • Identify users to notify about program changes
  • Export user lists for program documentation

What you'll need:

  • Program ID (get from GET /apricot/programs)
  • Optional: Pagination, sorting, and filtering parameters
  • Access token with apricot.read scope

What you'll get back: Array of user objects with access to this program, each containing:

  • User ID, username, email
  • User's full name (first and last)
  • User role and permissions level
  • Active status
  • Last login information
  • User metadata

Common use cases:

  • Access Control: "Who can see this program's data?"
  • Team Management: List all case workers in the Housing program
  • Notifications: Get emails of users to notify about program updates
  • Reporting: Generate staff rosters per program
  • Troubleshooting: Verify why a user can/cannot access program data

Filtering & Pagination:

  • Filter by active status, role, or name
  • Sort by name, last login, or role
  • Paginate large user lists

Note: This returns users with explicit program access. System administrators may have access to all programs without being explicitly listed.

Authorizations:
authorizer-lambdaapi_key
path Parameters
id
required
integer <int32>
query Parameters
object
Example: page[number]=1&page[size]=25

Pagination parameters for limiting result set size

sort
string
Examples:
  • sort=-creation_time - Sort by creation time, newest first
  • sort=name - Sort by name alphabetically

Sort order for results. Prefix with '-' for descending order

object
Example: filter[active]=1&filter[name]=Client

Filter parameters to narrow down results. Use field names as keys

Responses

Response Schema: application/json
object (ApricotMeta)

Metadata about the response, including pagination information

Array of objects (ApricotUser)

Array of user objects

Request samples

curl -X GET "https://api.bonterra.network/v1/apricot/programs/2/users" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response samples

Content type
application/json
{
  • "meta": {
    },
  • "data": [
    ]
}

Apricot Metadata

Get user metadata by key

What it does: Retrieves the metadata value associated with a specific key for a user. User metadata allows you to store custom key-value pairs for users, enabling extensibility beyond standard user fields.

When to use it:

  • Retrieve custom user preferences or settings
  • Get integration-specific data stored for a user
  • Access user configuration from external systems
  • Read custom attributes not in the standard user schema
  • Check feature flags or permissions stored as metadata
  • Retrieve API-specific tracking information

What you'll need:

  • User ID
  • Metadata key name (e.g., "preferred_language", "external_id", "notification_settings")
  • Access token with apricot.read scope

What you'll get back: The metadata value for the specified key, which can be:

  • String values (e.g., "en-US", "enabled")
  • Numeric values
  • JSON objects for complex data
  • Timestamps or dates

Common metadata keys:

  • external_system_id - ID from integrated system
  • preferred_language - User's language preference
  • notification_preferences - Communication settings
  • last_sync_time - Integration sync timestamp
  • custom_permissions - Role-based access flags
Authorizations:
authorizer-lambdaapi_key
path Parameters
id
required
integer <int32>
query Parameters
key
string
header Parameters
Authorization
required
string

Header that carries token for request Authorization

Responses

Response Schema: application/vnd.api+json
object (ApricotMeta)

Metadata about the response, including pagination information

Array of objects (ApricotUser)

Array of user objects

Request samples

curl -X GET "https://api.bonterra.network/v1/apricot/users/123/metadata?key=external_system_id" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response samples

Content type
application/vnd.api+json
{
  • "meta": {
    },
  • "data": [
    ]
}

Update or create user metadata

What it does: Creates or updates a metadata key-value pair for a user. If the key already exists, its value is updated. If the key doesn't exist, it's created. This allows you to store custom data associated with users.

When to use it:

  • Store custom user preferences or settings
  • Save integration-specific identifiers
  • Maintain external system mappings
  • Store feature flags or permissions
  • Save user-specific configuration
  • Track custom attributes not in standard schema
  • Persist API-related state information

What you'll need:

  • User ID
  • Metadata key name (string identifier)
  • Metadata value (can be string, number, boolean, or JSON object)
  • Access token with apricot.update scope

What you'll get back: Confirmation of the updated/created metadata including:

  • The key that was updated
  • The new value
  • User ID
  • Timestamp of the update

Best practices:

  • Use descriptive, namespaced key names (e.g., "salesforce_contact_id" not "id")
  • Keep values reasonably sized (avoid storing large documents)
  • Use consistent data types for each key across users
  • Document your metadata schema for your team

Common use cases:

  • Storing external system IDs for bi-directional sync
  • Saving user preferences that aren't in standard fields
  • Tracking integration-specific timestamps
  • Maintaining custom permissions or feature access
Authorizations:
authorizer-lambdaapi_key
path Parameters
id
required
integer <int32>
header Parameters
Authorization
required
string

Header that carries token for request Authorization

Request Body schema:
required

Metadata key-value pair to create or update

key
string
value
string

Responses

Response Schema: application/vnd.api+json
object (ApricotMeta)

Metadata about the response, including pagination information

Array of objects (ApricotUser)

Array of user objects

Request samples

Content type
{
  • "key": "external_system_id",
  • "value": "SF-12345"
}

Response samples

Content type
application/vnd.api+json
{
  • "meta": {
    },
  • "data": [
    ]
}

Delete user metadata by key

What it does: Permanently deletes a metadata key-value pair for a specific user. Once deleted, the metadata cannot be recovered unless you re-create it with a PUT request.

When to use it:

  • Remove outdated custom user settings
  • Clear integration-specific data that's no longer needed
  • Delete temporary flags or markers
  • Clean up test metadata
  • Remove deprecated custom attributes
  • Clear cached or stale integration data

What you'll need:

  • User ID
  • Metadata key name to delete
  • Access token with apricot.delete scope

What you'll get back: Confirmation that the metadata was deleted, including:

  • Success status
  • The key that was deleted
  • User ID

Important notes:

  • This is a permanent deletion - the metadata cannot be recovered
  • Deleting a non-existent key will typically return a success response
  • Only the specified key is deleted; other metadata for the user remains intact
  • Consider using PUT with an empty/null value if you want to preserve the key structure

Common scenarios:

  • Removing external system mappings after integration is disabled
  • Clearing temporary feature flags after testing
  • Deleting cached data that should be refreshed
  • Cleaning up user-specific integration state
Authorizations:
authorizer-lambdaapi_key
path Parameters
id
required
integer <int32>
query Parameters
key
string
header Parameters
Authorization
required
string

Header that carries token for request Authorization

Responses

Response Schema: application/vnd.api+json
object (ApricotMeta)

Metadata about the response, including pagination information

Array of objects (ApricotUser)

Array of user objects

Request samples

curl -X DELETE "https://api.bonterra.network/v1/apricot/users/123/metadata?key=external_system_id" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response samples

Content type
application/vnd.api+json
{
  • "meta": {
    },
  • "data": [
    ]
}

Apricot Programs

Get list of programs

Retrieves a list of all programs in your Apricot instance. Programs are used to organize records and users by service type or department.

Common use cases:

  • List all programs for administrative purposes
  • Get program IDs for filtering records
  • Display programs in UI dropdowns
  • Export program configurations
Authorizations:
authorizer-lambdaapi_key
query Parameters
object
Example: page[number]=1&page[size]=25

Pagination parameters for limiting result set size

sort
string
Examples:
  • sort=-creation_time - Sort by creation time, newest first
  • sort=name - Sort by name alphabetically

Sort order for results. Prefix with '-' for descending order

object
Example: filter[active]=1&filter[name]=Client

Filter parameters to narrow down results. Use field names as keys

Responses

Response Schema: application/json
Array of objects (ApricotProgram)

Array of program objects

Request samples

curl -X GET "https://api.bonterra.network/v1/apricot/programs" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response samples

Content type
application/json
{
  • "data": [
    ]
}

Create a new program

What it does: Creates a new program in your Apricot instance. Programs are the top-level organizational structure used to group related forms, records, and users. Each program typically represents a distinct service area, grant-funded initiative, or department.

When to use it:

  • Set up a new service program or initiative
  • Create a program for a new grant or funding source
  • Establish a departmental data collection area
  • Organize data for different service populations
  • Separate data by geographic region or location
  • Create programs for different fiscal years

What you'll need:

  • Program name (required, must be unique)
  • Program description (optional but recommended)
  • Active status (defaults to true)
  • Optional: Form IDs to associate with this program
  • Optional: User IDs to grant access to this program
  • Access token with apricot.create scope

What you'll get back: The newly created program object including:

  • Unique program ID (use this for record creation)
  • All provided attributes
  • Creation timestamp
  • Default settings for new programs

Important notes:

  • Program names must be unique within your Apricot instance
  • New programs start as active by default
  • You can add forms and users to the program later
  • Programs cannot be deleted via API (deactivate instead)

Common program types:

  • Service delivery programs (e.g., "Housing Assistance", "Job Training")
  • Grant-funded initiatives (e.g., "2025 SAMHSA Grant")
  • Administrative divisions (e.g., "Northern Region", "Youth Services")
  • Time-based programs (e.g., "FY2025 Emergency Relief")
Authorizations:
authorizer-lambdaapi_key
Request Body schema:
required

Program data for the new program

type
required
string

Resource type, must be 'programs'

id
integer <int32>

The ID of the program (for updates)

object

Program attributes

Responses

Response Schema: application/json
Array of objects (ApricotProgram)

Array of program objects

Request samples

Content type
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "data": [
    ]
}

Get a specific program by ID

What it does: Retrieves detailed information about a specific program. Programs in Apricot are organizational containers that group related forms, records, and users together, representing distinct service areas or organizational divisions.

When to use it:

  • Get details about a specific program
  • Check if a program is active before creating records
  • Retrieve program metadata and configuration
  • Verify program names and descriptions
  • Build program-specific dashboards or reports
  • Validate program IDs before assigning records

What you'll need:

  • Program ID (get from GET /apricot/programs)
  • Access token with apricot.read scope

What you'll get back: Complete program object including:

  • id - Unique program identifier
  • name - Program name (e.g., "Youth Services", "Housing Assistance")
  • description - Program description
  • active - Whether the program is currently active
  • form_ids - Array of form IDs associated with this program
  • user_ids - Array of user IDs who have access to this program
  • created_at - When the program was created
  • updated_at - Last modification timestamp
  • Custom program-level fields and metadata

Program hierarchy: Programs can contain multiple forms, and each form can contain multiple records. Understanding the program structure is essential for proper data organization.

Authorizations:
authorizer-lambdaapi_key
path Parameters
id
required
integer <int32>

Responses

Response Schema: application/json
Array of objects (ApricotProgram)

Array of program objects

Request samples

curl -X GET "https://api.bonterra.network/v1/apricot/programs/2" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response samples

Content type
application/json
{
  • "data": [
    ]
}

Update a program

What it does: Updates an existing program's properties. You can modify the program name, description, active status, and other program-level attributes. This operation performs a partial update, so you only need to include the fields you want to change.

When to use it:

  • Change a program's name or description
  • Activate or deactivate a program
  • Update program settings or configuration
  • Modify program metadata
  • Update program associations (forms, users)
  • Correct program information

What you'll need:

  • Program ID
  • Fields you want to update (only send fields that should change)
  • Access token with apricot.update scope

What you'll get back: The complete updated program object with all fields, including:

  • All attributes (both changed and unchanged)
  • Updated timestamp showing when the modification occurred
  • Confirmation of the new values

Important notes:

  • This is a partial update - only include fields you want to change
  • The id field in the request body must match the URL path parameter
  • Changing a program to inactive may affect record creation
  • Some fields may be read-only depending on your permissions

Common update scenarios:

  • Deactivating a program at the end of a grant period
  • Renaming a program for clarity
  • Updating program descriptions as services evolve
  • Modifying program settings for new requirements
Authorizations:
authorizer-lambdaapi_key
path Parameters
id
required
integer <int32>
Request Body schema:
required

Program fields to update (partial update supported)

type
required
string

Resource type, must be 'programs'

id
integer <int32>

The ID of the program (for updates)

object

Program attributes

Responses

Response Schema: application/json
Array of objects (ApricotProgram)

Array of program objects

Request samples

Content type
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "data": [
    ]
}

Get program configuration for Connect intake

What it does: Retrieves program configuration optimized for Bonterra Connect's intake process. This endpoint returns program information in a format specifically designed for cross-product integration, particularly for referral and intake workflows between Connect and Apricot.

When to use it:

  • Integrate Apricot programs with Bonterra Connect
  • Set up cross-system referral workflows
  • Configure Connect intake forms that create Apricot records
  • Build unified intake experiences across products
  • Synchronize program configurations between systems
  • Enable seamless referrals from Connect to Apricot programs

What you'll need:

  • Program ID from Apricot
  • Access token with cross-product permissions
  • Connect integration enabled for your organization

What you'll get back: Program object with Connect-specific configuration:

  • Program ID, name, and description
  • Intake-relevant program settings
  • Form associations for intake processes
  • Field mappings for Connect-to-Apricot data flow
  • Program active status
  • Integration-specific metadata

Integration scenario:

  1. Connect receives a referral or intake request
  2. Connect queries this endpoint to get Apricot program details
  3. User selects which Apricot program to refer client to
  4. Connect creates a record in Apricot using the program configuration
  5. Client data flows from Connect intake to Apricot program

vs. GET /programs/{id}:

  • This endpoint: Optimized for Connect integration (specific format)
  • GET /programs/{id}: Standard program details (general use)

Note: This is a specialized endpoint for Bonterra product integration. If you're not integrating with Connect, use the standard GET /programs/{id} endpoint instead.

Authorizations:
authorizer-lambdaapi_key
path Parameters
id
required
integer <int32>

Responses

Response Schema: application/json
type
required
string

The type of Apricot record you are sending

id
integer <int32>

The ID of the Apricot Program

object

Request samples

curl -X GET "https://api.bonterra.network/v1/apricot/programs/2/intake" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response samples

Content type
application/json
{
  • "type": "programs",
  • "id": 1,
  • "attributes": {
    }
}

Get users who have access to a program

What it does: Retrieves a list of all users who have been granted access to a specific program. This helps you manage program-level permissions and understand who can view/edit data within a program.

When to use it:

  • Audit which users have access to a program
  • Manage program-level user permissions
  • Verify user access before assigning work
  • Build user access reports and matrices
  • Onboard new staff to see team composition
  • Identify users to notify about program changes
  • Export user lists for program documentation

What you'll need:

  • Program ID (get from GET /apricot/programs)
  • Optional: Pagination, sorting, and filtering parameters
  • Access token with apricot.read scope

What you'll get back: Array of user objects with access to this program, each containing:

  • User ID, username, email
  • User's full name (first and last)
  • User role and permissions level
  • Active status
  • Last login information
  • User metadata

Common use cases:

  • Access Control: "Who can see this program's data?"
  • Team Management: List all case workers in the Housing program
  • Notifications: Get emails of users to notify about program updates
  • Reporting: Generate staff rosters per program
  • Troubleshooting: Verify why a user can/cannot access program data

Filtering & Pagination:

  • Filter by active status, role, or name
  • Sort by name, last login, or role
  • Paginate large user lists

Note: This returns users with explicit program access. System administrators may have access to all programs without being explicitly listed.

Authorizations:
authorizer-lambdaapi_key
path Parameters
id
required
integer <int32>
query Parameters
object
Example: page[number]=1&page[size]=25

Pagination parameters for limiting result set size

sort
string
Examples:
  • sort=-creation_time - Sort by creation time, newest first
  • sort=name - Sort by name alphabetically

Sort order for results. Prefix with '-' for descending order

object
Example: filter[active]=1&filter[name]=Client

Filter parameters to narrow down results. Use field names as keys

Responses

Response Schema: application/json
object (ApricotMeta)

Metadata about the response, including pagination information

Array of objects (ApricotUser)

Array of user objects

Request samples

curl -X GET "https://api.bonterra.network/v1/apricot/programs/2/users" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response samples

Content type
application/json
{
  • "meta": {
    },
  • "data": [
    ]
}

Copy/clone a program

What it does: Creates a copy (clone) of an existing program, duplicating its structure, forms, and configuration. This is useful when you need to create a new program with similar settings to an existing one, saving time compared to manually recreating everything from scratch.

When to use it:

  • Create a new program based on an existing template
  • Replicate a program structure for a new grant year or funding cycle
  • Establish similar programs for different geographic regions
  • Set up pilot programs based on existing successful programs
  • Create backup copies of program configurations
  • Standardize program structure across your organization

What you'll need:

  • Source program ID (the program to copy from)
  • New program name (must be unique)
  • Optional: New program description and settings
  • Access token with apricot.create scope

What gets copied:

  • Program structure and configuration
  • Associated forms (references, not duplicates)
  • Form field configurations
  • Program-level settings and metadata
  • User access permissions (optionally)

What does NOT get copied:

  • Actual records (data)
  • Record-level attachments or files
  • Historical data or audit logs
  • Program-specific customizations that aren't transferable

What you'll get back: The newly created program object including:

  • New unique program ID
  • All copied attributes and settings
  • Creation timestamp
  • Confirmation of successful duplication

Important notes:

  • The new program name must be unique
  • Records from the source program are NOT copied
  • Form associations are copied, but forms themselves are shared (not duplicated)
  • You may need to adjust user access permissions after copying

Common scenarios:

  • "Youth Services 2024" → "Youth Services 2025"
  • "Regional Program - North" → "Regional Program - South"
  • "Pilot Housing Assistance" → "Housing Assistance Program"
  • Template programs for standardizing across departments
Authorizations:
authorizer-lambdaapi_key
path Parameters
id
required
integer <int32>
Request Body schema: application/json
required

New program details for the copy

type
required
string

Resource type, must be 'programs'

id
integer <int32>

The ID of the program (for updates)

object

Program attributes

Responses

Response Schema: application/vnd.api+json
type
required
string

The type of Apricot record you are sending

id
integer <int32>

The ID of the Apricot Program

object

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/vnd.api+json
{
  • "type": "programs",
  • "id": 1,
  • "attributes": {
    }
}

Get a list of all Apricot Programs for Connect Intake

Get a list of all Apricot Programs for Connect Intake

Authorizations:
authorizer-lambdaapi_key
query Parameters
object
Example: page[number]=1&page[size]=25

Pagination parameters for limiting result set size

sort
string
Examples:
  • sort=-creation_time - Sort by creation time, newest first
  • sort=name - Sort by name alphabetically

Sort order for results. Prefix with '-' for descending order

object
Example: filter[active]=1&filter[name]=Client

Filter parameters to narrow down results. Use field names as keys

Responses

Response Schema: application/json
Array of objects (ApricotProgram)

Array of program objects

Response samples

Content type
application/json
{
  • "data": [
    ]
}

Apricot Records

Get records by form ID

Retrieves all records for a specific form. Use this endpoint to fetch a list of records that belong to a particular form. Results can be paginated.

Common use cases:

  • List all client intake records
  • Export form data for reporting
  • Sync records with external systems
Authorizations:
authorizer-lambdaapi_key
query Parameters
form_id
required
integer <int32>
Example:

The ID of the form to query records from

header Parameters
Authorization
required
string

Header that carries token for request Authorization

Request Body schema: application/json
required
id
integer <int32>

Unique identifier for the record

type
string

Resource type, always 'records' for record objects

object

Contains the form field data and metadata for this record

object (ApricotLinks)

Hypermedia links for navigation and resource discovery

Responses

Response Schema: application/json
object (ApricotMeta)

Metadata about the response, including pagination information

Array of objects (ApricotRecord)

Array of record objects

Request samples

Content type
application/json
{
  • "id": 12345,
  • "type": "records",
  • "attributes": {
    },
  • "links": {
    }
}

Response samples

Content type
application/json
{
  • "meta": {
    },
  • "data": [
    ]
}

Create a new record

What it does: Creates a new record in the specified form. This endpoint supports three content types for different use cases, including the ability to create a record with file attachments in a single request.

When to use it:

  • Add a new client intake record
  • Create records programmatically from external systems
  • Bulk import data into Apricot
  • Create records with initial file attachments (using multipart/form-data)

What you'll need:

  • Form ID (required - get this from GET /apricot/forms)
  • Field values matching your form's field IDs (field_1001, field_1002, etc.)
  • For attachments: Files to upload (PDF, DOCX, images, etc.)
  • Access token with apricot.create scope

What you'll get back: Newly created record with ID and all field values including attachment metadata if files were uploaded

Three Content Type Options:

1. application/json (Most common) Use for creating records without files. Simple JSON body with field values.

2. application/vnd.api+json (JSON API format) Use if your application follows JSON API specification.

3. multipart/form-data (For records with attachments - Option 1) Use when creating a new record AND you have files ready to attach immediately. This is the "Option 1" approach for working with attachments.

Two Approaches for Attachments:

Option 1: Create Record with Attachments (this endpoint with multipart/form-data)

  • ✅ Atomic operation - record and files created together
  • ✅ Best for: New records with initial attachments
  • ✅ All data and files ready at once
  • Use multipart/form-data content type
  • See examples below

Option 2: Add Attachment to Existing Record

  • Use POST /apricot/records/{id}/attachment/{field_id}
  • Best for adding files to existing records
  • See that endpoint for details

Field Naming Patterns: Field IDs follow specific patterns based on field type:

  • Simple fields: field_1001, field_1002
  • Name fields: field_2_first, field_2_last
  • Address fields: field_99_line1, field_99_city, field_99_state, field_99_zip
  • Attachment fields: field_827, field_950 (uploaded as files in multipart/form-data)

Important notes:

  • The form_id parameter is required (query parameter or in attributes)
  • Field IDs are specific to each form's configuration
  • Use GET /apricot/forms/{id} to discover available fields and their IDs
  • For multipart/form-data: include 'data' field with JSON, then add file fields
  • Do NOT set Content-Type header manually when using multipart/form-data
  • Programs array is optional but recommended for multi-program forms
Authorizations:
authorizer-lambdaapi_key
query Parameters
form_id
required
integer <int32>
Example:

The ID of the form to query records from

header Parameters
Authorization
required
string

Header that carries token for request Authorization

Request Body schema:
required

For JSON requests (application/json or application/vnd.api+json): Send record data as JSON with type and attributes.

For multipart/form-data (creating record with attachments):

  • Include 'data' field containing the JSON record data as a string
  • Add file fields using field IDs (e.g., field_827, field_950)
  • Do NOT set Content-Type header - let client set it with boundary
type
required
string

Resource type, must be 'records'

object (ApricotRecordBodyAttributes)

Attributes for creating or updating a record. Field names are dynamic based on form definition (e.g., field_1001, field_1002).

Array of objects (ApricotRecordBodyMetadata)

Optional metadata array to bypass UI validation requirements when creating/updating records

Responses

Response Schema: application/json
object (ApricotMeta)

Metadata about the response, including pagination information

Array of objects (ApricotRecord)

Array of record objects

Request samples

Content type
Example
{
  • "type": "records",
  • "attributes": {
    }
}

Response samples

Content type
application/json
{
  • "meta": {
    },
  • "data": [
    ]
}

Get a specific record by ID

What it does: Retrieves a single record by its unique identifier. Returns the complete record including all field values, metadata, attachment information, timestamps, and relationships.

When to use it:

  • View detailed information for a specific client or record
  • Retrieve current record data before updating (recommended before PUT)
  • Check if a record exists and is accessible
  • Get attachment metadata for files associated with the record
  • Fetch related record information via links
  • Verify successful record creation

What you'll need:

  • Record ID (from POST /records response or GET /records list)
  • Access token with apricot.read scope

What you'll get back: Complete record object containing:

  • id - The unique record identifier
  • type - Resource type (always "records")
  • attributes - All field values including:
    • form_id - The form this record belongs to
    • programs - Array of program IDs
    • Dynamic fields (field_1001, field_2_first, etc.)
    • Attachment metadata (filename, size, URL) for any file fields
    • creation_time, modify_time - Timestamps
  • links - Navigation URLs (self, form, related records)

Understanding the Response:

  • Field values match the field IDs from the form structure
  • Attachment fields contain file metadata objects with download URLs
  • Empty/null fields indicate no value was set
  • Timestamps are in ISO 8601 format

Important notes:

  • Returns 404 if record doesn't exist or you don't have permission
  • Use this before PUT to get current values and avoid overwriting data
  • Attachment fields show metadata but don't include file contents
  • Use GET /records/{id}/attachment/{field_id} to download actual files
  • Links section provides URLs to related resources
Authorizations:
authorizer-lambdaapi_key
path Parameters
id
required
integer <int32>
header Parameters
Authorization
required
string

Header that carries token for request Authorization

Responses

Response Schema: application/vnd.api+json
id
integer <int32>

Unique identifier for the record

type
string

Resource type, always 'records' for record objects

object

Contains the form field data and metadata for this record

object (ApricotLinks)

Hypermedia links for navigation and resource discovery

Request samples

curl -X GET "https://api.bonterra.network/v1/apricot/records/123" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response samples

Content type
application/vnd.api+json
{
  • "id": 12345,
  • "type": "records",
  • "attributes": {
    },
  • "links": {
    }
}

Update an existing record

What it does: Updates an existing record with new field values. You can update one field or multiple fields in a single request. Fields not included in the request remain unchanged.

When to use it:

  • Update client or participant information
  • Change record status, category, or other field values
  • Modify specific fields without affecting others
  • Correct or update existing data
  • Mark records as active/inactive

What you'll need:

  • Record ID (from GET /records or POST /records response)
  • Field values to update (only include fields you want to change)
  • Access token with apricot.update scope
  • Best practice: GET the record first to see current values

What you'll get back: Updated record object with all field values (not just the ones you updated)

Two Update Strategies:

Strategy 1: Partial Update (Recommended for most cases) Only send the fields you want to change. Other fields remain unchanged.

  • ✅ Simpler - less data to send
  • ✅ Faster - smaller payload
  • ⚠️ Risk: If another update happened between your GET and PUT, those changes are preserved

Strategy 2: Full Update (Safest for critical data) GET the record first, modify the fields you want, then PUT the complete attributes object.

  • ✅ Safer - you see exactly what you're changing
  • ✅ Prevents accidental overwrites
  • ⚠️ Slower - requires two API calls

Important notes:

  • Only fields in your request will be updated
  • Omitted fields keep their current values
  • Cannot update id, creation_time, or other system fields
  • Use GET first to retrieve current values (recommended)
  • Returns 404 if record doesn't exist
  • Returns 409 if there's a conflict (e.g., concurrent updates)
  • To update attachments, use POST /records/{id}/attachment/{field_id}
  • form_id and programs can be updated to move records between forms/programs

Common Issues:

"Required field missing" error:

  • Cause: Form has required fields that are empty
  • Solution: Include all required fields in your update, or use metadata.uiRequirementsToBypass

409 Conflict error:

  • Cause: Record was modified by another request between your GET and PUT
  • Solution: GET the latest version and retry your update

Accidentally clearing fields:

  • Problem: Sending null or empty string clears the field
  • Solution: Only include fields you explicitly want to change
Authorizations:
authorizer-lambdaapi_key
path Parameters
id
required
integer <int32>
header Parameters
Authorization
required
string

Header that carries token for request Authorization

Request Body schema:
required

Update request body containing the fields to modify.

Partial update: Include only the fields you want to change Full update: Include all attributes from GET response with your changes

type
required
string

Resource type, must be 'records'

object (ApricotRecordBodyAttributes)

Attributes for creating or updating a record. Field names are dynamic based on form definition (e.g., field_1001, field_1002).

Array of objects (ApricotRecordBodyMetadata)

Optional metadata array to bypass UI validation requirements when creating/updating records

Responses

Response Schema: application/vnd.api+json
id
integer <int32>

Unique identifier for the record

type
string

Resource type, always 'records' for record objects

object

Contains the form field data and metadata for this record

object (ApricotLinks)

Hypermedia links for navigation and resource discovery

Request samples

Content type
Example
{
  • "type": "records",
  • "attributes": {
    }
}

Response samples

Content type
application/vnd.api+json
{
  • "id": 12345,
  • "type": "records",
  • "attributes": {
    },
  • "links": {
    }
}

Get a record's attachment file

Authorizations:
authorizer-lambdaapi_key
path Parameters
id
required
integer <int32>
field_id
required
integer <int32>
header Parameters
Authorization
required
string

Header that carries token for request Authorization

Responses

Response Schema: application/vnd.api+json
id
string
name
string
email
string
role
string
createdAt
string
updatedAt
string

Response samples

Content type
application/vnd.api+json
{
  • "id": "string",
  • "name": "string",
  • "email": "string",
  • "role": "string",
  • "createdAt": "string",
  • "updatedAt": "string"
}

Upload or update an attachment for a record

What it does: Uploads a file attachment to a specific field on an existing record. This is one of two ways to add attachments to records in Apricot.

When to use it:

  • Adding files to an existing record
  • Updating or replacing existing attachments
  • Uploading files after record creation
  • File-only operations without changing other record data

What you'll need:

  • Record ID (from a previously created record)
  • Field ID (the attachment field from your form - see "Finding Field IDs" below)
  • File to upload (PDF, DOCX, XLSX, PNG, JPG, etc.)
  • Access token with apricot.create or apricot.update scope

What you'll get back: Success response with attachment metadata including file ID, filename, size, and download URL

Two Approaches for Working with Attachments:

Option 1: Create Record with Attachments (multipart/form-data) Use this when creating a new record and you have files ready to attach immediately. See POST /apricot/records with Content-Type: multipart/form-data

  • ✅ Atomic operation - record and files created together
  • ✅ Best for: New records with initial attachments
  • ✅ All data and files ready at once

Option 2: Add Attachment to Existing Record (this endpoint) Use this endpoint when working with existing records.

  • ✅ Best for: Adding files to existing records
  • ✅ Updating or replacing attachments
  • ✅ File-only operations

Finding Field IDs: To find which field_id to use for attachments:

  1. Call GET /apricot/forms/{form_id} to get the form structure
  2. Look for fields where field_type_id indicates an attachment field
  3. Use the field's id value as the field_id parameter

Example: If you see a field with id: 827 and it's an attachment type, use field_id=827

Important notes:

  • Field ID must be a valid attachment field on the form
  • File size limits apply (check your Apricot instance settings)
  • Supported file types: PDF, DOCX, XLSX, PNG, JPG, GIF, TXT, CSV, and more
  • Do NOT manually set Content-Type header - let your HTTP client set it with the multipart boundary
  • Previous attachment on this field will be replaced with the new file

Common Issues:

"Field not found" error:

  • Cause: Invalid field_id or field is not an attachment type
  • Solution: Use GET /apricot/forms/{form_id} to verify field exists and is correct type

"Invalid file type" error:

  • Cause: File type not supported
  • Solution: Check file MIME type and ensure it's a supported format

Content-Type header issues:

  • Problem: Setting Content-Type manually breaks multipart upload
  • Solution: Let your HTTP client/library set Content-Type automatically with boundary
Authorizations:
authorizer-lambdaapi_key
path Parameters
id
required
integer <int32>
field_id
required
integer <int32>
header Parameters
Authorization
required
string

Header that carries token for request Authorization

Request Body schema: multipart/form-data
required

Upload a file using multipart/form-data. The file should be sent in a form field named "file".

Important: Do not set Content-Type header manually - your HTTP client will set it correctly with the multipart boundary.

file
string <binary>

The file to upload (PDF, DOCX, PNG, JPG, etc.)

Responses

Response Schema: application/json
object

Request samples

Content type
multipart/form-data
Example
{
  "file": "(binary file data)"
}

Response samples

Content type
application/json
Example
{
  • "data": {
    }
}

Create an external referral for a record

What it does: Creates an external referral linking a record to services or organizations outside your Apricot system. This tracks when you refer a client to external resources such as other agencies, healthcare providers, housing services, or community programs.

When to use it:

  • Refer a client to an external service provider
  • Track referrals to partner organizations
  • Document connections to community resources
  • Record referrals to healthcare, housing, employment services
  • Maintain a history of external service coordination
  • Generate referral reports and analytics

What you'll need:

  • Record ID of the client/participant being referred
  • Organization or service name being referred to
  • Referral details (reason, date, contact information)
  • Status of the referral (pending, completed, etc.)
  • Access token with apricot.create scope

What you'll get back: The created referral object including:

  • Referral ID
  • Organization/service details
  • Referral date and status
  • Any notes or follow-up information
  • Link back to the original record

Common referral scenarios:

  • Mental health services referral
  • Housing assistance referral
  • Job training program referral
  • Medical care referral
  • Legal aid referral
Authorizations:
authorizer-lambdaapi_key
path Parameters
id
required
integer <int32>
header Parameters
Authorization
required
string

Header that carries token for request Authorization

Request Body schema: application/vnd.api+json
required

External referral details

type
required
string
object (ApricotExternalReferralBodyAttributes)

Responses

Response Schema: application/vnd.api+json
object (ApricotMeta)

Metadata about the response, including pagination information

Array of objects (ApricotRecord)

Array of record objects

Request samples

Content type
application/vnd.api+json
{
  • "data": {
    }
}

Response samples

Content type
application/vnd.api+json
{
  • "meta": {
    },
  • "data": [
    ]
}

Get a record's internal program referrals

What it does: Retrieves all internal program referrals for a specific record. This shows when a record (typically a client/participant) has been referred from one program to another within your Apricot system, enabling cross-program service coordination and tracking.

When to use it:

  • View all programs a client has been referred to
  • Track cross-program service delivery
  • Understand a client's service history across multiple programs
  • Generate reports on inter-program referral patterns
  • Identify warm handoffs between service areas
  • Monitor program collaboration and coordination

What you'll need:

  • Record ID of the client/participant
  • Optional: Key parameter to filter specific referral attributes
  • Access token with apricot.read scope

What you'll get back: Collection of program referral objects, each containing:

  • Referring program information
  • Target program information
  • Referral date and status
  • Referral reason or notes
  • Staff who made the referral
  • Follow-up information

Common program referral scenarios:

  • Emergency assistance → Long-term case management
  • Intake services → Specialized treatment programs
  • Youth services → Adult services (age transition)
  • Crisis intervention → Ongoing support programs
  • Assessment → Service-specific programs
Authorizations:
authorizer-lambdaapi_key
path Parameters
id
required
integer <int32>
query Parameters
key
string
header Parameters
Authorization
required
string

Header that carries token for request Authorization

Responses

Response Schema: application/vnd.api+json
object (ApricotMeta)

Metadata about the response, including pagination information

Array of objects (ApricotRecord)

Array of record objects

Request samples

curl -X GET "https://api.bonterra.network/v1/apricot/records/12345/referrals/programs" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response samples

Content type
application/vnd.api+json
{
  • "meta": {
    },
  • "data": [
    ]
}

Get list of available record actions

What it does: Retrieves a list of all possible actions that can be performed on records in your Apricot system. Record actions are workflow operations like approvals, reviews, status changes, or other custom actions configured in your Apricot instance.

When to use it:

  • Discover what actions are available in your system
  • Build dynamic UI workflows based on available actions
  • Validate action names before triggering workflow operations
  • Document your organization's record processing workflows
  • Create automation scripts that respect configured actions
  • Map external system statuses to Apricot actions

What you'll need:

  • Access token with apricot.read scope
  • No additional parameters required

What you'll get back: Array of action objects, each containing:

  • Action ID
  • Action name (e.g., "Approve", "Review", "Complete", "Archive")
  • Action description
  • Permission requirements for the action
  • Which record types/forms the action applies to
  • Any custom action configurations

Common record actions:

  • Submit for review
  • Approve/Reject
  • Mark as complete
  • Archive/Reactivate
  • Escalate
  • Assign to user
  • Change status
  • Lock/Unlock

Note: The specific actions available depend on your Apricot configuration and may include custom actions created by your organization.

Authorizations:
authorizer-lambdaapi_key
header Parameters
Authorization
required
string

Header that carries token for request Authorization

Responses

Response Schema: application/json
object (ApricotMeta)

Metadata about the response, including pagination information

Array of objects (ApricotRecordAction)

Request samples

curl -X GET "https://api.bonterra.network/v1/apricot/records/actions" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response samples

Content type
application/json
{
  • "meta": {
    },
  • "data": [
    ]
}

Batch retrieve records by IDs and form

What it does: Retrieves multiple specific records by providing a form ID and an array of document/record IDs. This is a targeted batch retrieval endpoint that lets you fetch exact records you need without filtering through a full list.

When to use it:

  • Fetch specific records when you already have their IDs
  • Retrieve records referenced by external systems
  • Get records after a search operation that returned IDs
  • Bulk fetch records for export or reporting
  • Synchronize specific records with external databases
  • Load related records efficiently in one request

What you'll need:

  • Form ID (which form the records belong to)
  • Array of record IDs (document IDs) to retrieve
  • Access token with apricot.read scope

What you'll get back: Collection of complete record objects matching the provided IDs, including:

  • All field values for each record
  • Record metadata (timestamps, form association)
  • Pagination information if needed
  • Only records that exist and you have permission to view

vs. Other record endpoints:

  • POST /records/data: Batch get by exact IDs (this endpoint)
  • GET /records: List/filter all records with pagination
  • POST /records/subset: Similar batch retrieval with different payload structure
  • POST /records/search: Search with complex filters and text matching

Important notes:

  • Non-existent IDs are silently ignored (no error)
  • You'll only get records you have permission to view
  • Large ID lists may be paginated
  • More efficient than making individual GET requests

Performance tip: When you need 10+ specific records, this is much faster than making individual GET /records/{id} calls.

Authorizations:
authorizer-lambdaapi_key
header Parameters
Authorization
required
string

Header that carries token for request Authorization

Request Body schema:
required

Form ID and array of record IDs to retrieve

type
required
string

Resource type, must be 'records'

object (ApricotRecordBodyAttributes)

Attributes for creating or updating a record. Field names are dynamic based on form definition (e.g., field_1001, field_1002).

Array of objects (ApricotRecordBodyMetadata)

Optional metadata array to bypass UI validation requirements when creating/updating records

Responses

Response Schema: application/json
object (ApricotMeta)

Metadata about the response, including pagination information

Array of objects (ApricotRecord)

Array of record objects

Request samples

Content type
{
  • "form_id": 2,
  • "document_ids": [
    ]
}

Response samples

Content type
application/json
{
  • "meta": {
    },
  • "data": [
    ]
}

Endpoint to search records by query

Authorizations:
authorizer-lambdaapi_key
query Parameters
form_id
required
integer <int32>
Example:

The ID of the form to query records from

search
required
string
Example:

Search query string to match against record fields

header Parameters
Authorization
required
string

Header that carries token for request Authorization

Responses

Response Schema: application/json
object (ApricotMeta)

Metadata about the response, including pagination information

Array of objects (ApricotRecord)

Array of record objects

Response samples

Content type
application/json
{
  • "meta": {
    },
  • "data": [
    ]
}

Search records with advanced options

What it does: Search for records using a flexible text query with powerful search options including fuzzy matching, wildcard placement, and field-specific search. More powerful than the simple GET /records?search= endpoint.

When to use it:

  • Find records by client name, email, or other text fields
  • Implement autocomplete or type-ahead search functionality
  • Search across specific fields only (not all fields)
  • Fine-tune search behavior (exact vs fuzzy matching)
  • Build advanced search UI with custom options
  • Filter records based on partial text matches

What you'll need:

  • Form ID (to specify which form's records to search)
  • Search query string (the text to search for)
  • Access token with apricot.read scope
  • Optional: Search configuration options (fuzzy, wildcards, field IDs)

What you'll get back: Array of matching records with pagination metadata, similar to GET /records

Search Options Explained:

form_id (required)

  • The form ID to search within
  • Get this from GET /apricot/forms

search (required)

  • The text query to search for
  • Searches across text fields in the form
  • Examples: "John Doe", "john@example.com", "Austin"

fieldIdsToMatch (optional)

  • Array of specific field IDs to search within
  • Example: [1001, 1002] - only search in field_1001 and field_1002
  • Default: Searches all text fields
  • Use GET /apricot/forms/{id} to find field IDs

disableFuzzy (optional, default: false)

  • When false: Fuzzy matching enabled (finds similar matches)
  • When true: Exact matching only
  • Example: With fuzzy disabled, "John" won't match "Jon"

disablePrefix (optional, default: false)

  • When false: Prefix matching enabled (finds words starting with query)
  • When true: Disable prefix matching
  • Example: "Aus" can match "Austin" when enabled

disableWildcard (optional, default: false)

  • When false: Wildcard matching enabled
  • When true: No wildcard expansion

wildcardPlacement (optional, default: "both")

  • "both": Add wildcards before and after query (query)
  • "pre": Add wildcard only before query (*query)
  • "post": Add wildcard only after query (query*)
  • Controls how partial matches work

Search Behavior Examples:

Example 1: Basic search (fuzzy enabled, both wildcards)

{"form_id": 2, "search": "john", "wildcardPlacement": "both"}

Matches: "John", "Johnny", "Johnson", "St. John"

Example 2: Exact search (no fuzzy, no wildcards)

{"form_id": 2, "search": "John Doe", "disableFuzzy": true, "disableWildcard": true}

Matches only: "John Doe" (exact)

Example 3: Starts-with search (post wildcard only)

{"form_id": 2, "search": "John", "wildcardPlacement": "post"}

Matches: "John", "Johnny", "Johnson" (but not "St. John")

Example 4: Search specific fields only

{"form_id": 2, "search": "example.com", "fieldIdsToMatch": [1002]}

Only searches in field_1002 (e.g., email field)

Important notes:

  • More permissive than GET /records with ?search parameter
  • Results are returned with pagination (use page[number] and page[size])
  • Searches text fields only (doesn't search dates, numbers, etc.)
  • Case-insensitive by default
  • Empty search string returns all records in the form
  • Use fieldIdsToMatch to improve performance when you know which fields to search
Authorizations:
authorizer-lambdaapi_key
header Parameters
Authorization
required
string

Header that carries token for request Authorization

Request Body schema: application/json
required

Search query with configuration options

Minimum required: form_id and search Optional: All other fields for fine-tuning search behavior

form_id
required
integer <int32>

ID of the form to search records in

search
required
string

Search query string to match against record fields

disableFuzzy
boolean
Default: false

Disable fuzzy matching (exact matches only)

disablePrefix
boolean
Default: false

Disable prefix matching

disableWildcard
boolean
Default: false

Disable wildcard matching

fieldIdsToMatch
Array of integers

Limit search to specific field IDs (if empty, searches all fields)

wildcardPlacement
string
Default: "both"
Enum: "both" "pre" "post"

Where to place wildcards in the search query

Responses

Response Schema: application/json
object (ApricotMeta)

Metadata about the response, including pagination information

Array of objects (ApricotRecord)

Array of record objects

Request samples

Content type
application/json
Example
{
  • "form_id": 2,
  • "search": "John Doe"
}

Response samples

Content type
application/json
{
  • "meta": {
    },
  • "data": [
    ]
}

Create a filtered subset of records

What it does: Creates a filtered subset of records based on specific criteria. This endpoint allows you to retrieve multiple records by providing an array of record IDs, effectively creating a custom collection of records without having to make individual requests.

When to use it:

  • Retrieve multiple specific records in a single request (batch fetch)
  • Get records by a pre-filtered list of IDs from another system
  • Build custom record collections for reporting
  • Fetch records that match external system IDs
  • Optimize performance by reducing API calls
  • Create data exports for specific record sets

What you'll need:

  • Array of record IDs you want to retrieve
  • Form ID (optional, to scope records to a specific form)
  • Access token with apricot.read scope

What you'll get back: Collection of complete record objects matching the provided IDs, including:

  • All field values for each record
  • Record metadata (creation time, last updated, etc.)
  • Form association
  • Pagination metadata if result set is large

Performance tip: This is more efficient than making individual GET requests for each record when you need to fetch multiple specific records at once.

Authorizations:
authorizer-lambdaapi_key
header Parameters
Authorization
required
string

Header that carries token for request Authorization

Request Body schema: application/json
required

Array of record IDs to retrieve

id
integer <int32>

Unique identifier for the record

type
string

Resource type, always 'records' for record objects

object

Contains the form field data and metadata for this record

object (ApricotLinks)

Hypermedia links for navigation and resource discovery

Responses

Response Schema: application/json
object (ApricotMeta)

Metadata about the response, including pagination information

Array of objects (ApricotRecord)

Array of record objects

Request samples

Content type
application/json
{
  • "record_ids": [
    ],
  • "form_id": 2
}

Response samples

Content type
application/json
{
  • "meta": {
    },
  • "data": [
    ]
}

Get unregistered portal participants

What it does: Retrieves records for participants who have not yet registered for the client portal. This is used to manage portal invitations and track which clients need portal access setup.

When to use it:

  • Identify clients who haven't registered for the portal
  • Generate portal invitation lists
  • Track portal onboarding progress
  • Send reminder emails to unregistered participants
  • Report on portal adoption rates

What you'll need:

  • Form ID and program filters
  • Access token with apricot.read scope

What you'll get back: Records for participants without portal registration.

Authorizations:
authorizer-lambdaapi_key
header Parameters
Authorization
required
string

Header that carries token for request Authorization

Request Body schema: application/json
required
form_id
required
integer <int32>
desired_fields
required
Array of strings
exclusions
Array of integers <int32> [ items <int32 > ]
last_mod_date
string or null
searching
string or null

Responses

Response Schema: application/json
object (ApricotMeta)

Metadata about the response, including pagination information

Array of objects (ApricotRecord)

Array of record objects

Request samples

Content type
application/json
{
  • "form_id": 0,
  • "desired_fields": [
    ],
  • "exclusions": [
    ],
  • "last_mod_date": "string",
  • "searching": "string"
}

Response samples

Content type
application/json
{
  • "meta": {
    },
  • "data": [
    ]
}

Apricot Forms

Get list of forms

Retrieves a list of all forms available in your Apricot instance. Forms are the templates used to collect data in records.

Common use cases:

  • Discover available forms in your database
  • Get form IDs for creating/querying records
  • List all active forms for UI dropdowns
  • Export form definitions

Response includes:

  • Form ID (needed for records API)
  • Form name and description
  • Active status
  • Creation and modification timestamps
Authorizations:
authorizer-lambdaapi_key
query Parameters
object
Example: page[number]=1&page[size]=25

Pagination parameters for limiting result set size

sort
string
Examples:
  • sort=-creation_time - Sort by creation time, newest first
  • sort=name - Sort by name alphabetically

Sort order for results. Prefix with '-' for descending order

object
Example: filter[active]=1&filter[name]=Client

Filter parameters to narrow down results. Use field names as keys

header Parameters
Authorization
required
string

Header that carries token for request Authorization

Responses

Response Schema: application/json
id
integer <int32>

Unique identifier for the form

type
string

Resource type, always 'forms'

object

Request samples

curl -X GET "https://api.bonterra.network/v1/apricot/forms" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response samples

Content type
application/json
{
  • "id": 100,
  • "type": "forms",
  • "attributes": {
    }
}

Get a specific form by ID

What it does: Retrieves detailed information about a specific form, including its complete structure, sections, field definitions, field types, and all field IDs. This is essential for working with records and attachments.

When to use it:

  • Discover field IDs for attachments (critical for using attachment endpoints)
  • Get complete form structure before creating records
  • Understand form configuration and field types
  • Find field IDs for dynamic field names (field_827, field_950, etc.)
  • Identify required fields vs optional fields
  • Export form definitions

What you'll need:

  • Form ID (get from GET /apricot/forms)
  • Access token with apricot.read scope

What you'll get back: Complete form structure including:

  • Form metadata (name, description, active status)
  • Sections array with all form sections
  • Fields array within each section containing:
    • id - The field ID to use in record creation (e.g., 827 → field_827)
    • field_type_id - Identifies the field type (text, dropdown, date, attachment, etc.)
    • label - Human-readable field name
    • is_required - Whether the field is mandatory
    • field_options - Available options for dropdown fields

CRITICAL: Finding Attachment Field IDs

This endpoint is essential for discovering which field IDs are attachment fields.

Steps to find attachment field IDs:

  1. Call GET /apricot/forms/{form_id}
  2. Look through the sections array
  3. Within each section, look through the fields array
  4. Find fields where field_type_id indicates an attachment field
  5. Note the id value - this is what you use for attachments

Example: If you find a field with id: 827 and it's an attachment type:

  • Use field_827 when creating records with attachments (multipart/form-data)
  • Use /records/{record_id}/attachment/827 for the attachment endpoint

Field Type Reference: Common field_type_id values:

  • 1 = Text (single line)
  • 2 = Dropdown/Select
  • 3 = Date
  • 4 = Checkbox
  • 5 = Text Area (multi-line)
  • 7 = Number
  • 8 = Attachment/File Upload
  • (Other types exist - check your form response)

Important notes:

  • Field IDs are unique to each form
  • Section IDs organize fields but aren't used in record creation
  • The sections.fields array shows fields in display order
  • Field options array shows available choices for dropdowns
  • Reference tags can be used as aliases for field IDs
Authorizations:
authorizer-lambdaapi_key
path Parameters
id
required
integer <int32>
header Parameters
Authorization
required
string

Header that carries token for request Authorization

Responses

Response Schema: application/vnd.api+json
id
integer <int32>
type
string
object
object (ApricotLinks)

Hypermedia links for navigation and resource discovery

Request samples

curl -X GET "https://api.bonterra.network/v1/apricot/forms/2" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response samples

Content type
application/vnd.api+json
{
  • "id": 0,
  • "type": "forms",
  • "attributes": {
    },
  • "links": {
    }
}

Get all fields for a specific form

What it does: Retrieves a complete list of all fields within a specific form. This is the most efficient way to get just the field definitions without the full form structure.

When to use it:

  • Quickly retrieve field IDs and types for a form
  • Build dynamic forms in your UI based on field definitions
  • Validate field data before creating records
  • Discover attachment field IDs (look for field_type_id indicating attachments)
  • Map field IDs to human-readable labels
  • Export field schemas for documentation

What you'll need:

  • Form ID (get from GET /apricot/forms)
  • Access token with apricot.read scope

What you'll get back: Array of field objects containing:

  • id - The field ID to use in records (e.g., 827 becomes field_827)
  • field_type_id - Field type identifier (text, number, date, attachment, etc.)
  • label - Human-readable field name shown in UI
  • is_required - Whether the field is mandatory
  • field_options - Available options for dropdown/multi-select fields
  • section_id - Which section the field belongs to
  • help_text - Additional guidance for the field

Note: This endpoint returns fields only. For complete form structure including sections and metadata, use GET /apricot/forms/{id} instead.

Authorizations:
authorizer-lambdaapi_key
path Parameters
id
required
integer <int32>
header Parameters
Authorization
required
string

Header that carries token for request Authorization

Responses

Response Schema: application/vnd.api+json
object (ApricotMeta)

Metadata about the response, including pagination information

Array of objects (ApricotFormField)

Request samples

curl -X GET "https://api.bonterra.network/v1/apricot/forms/2/fields" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response samples

Content type
application/vnd.api+json
{
  • "meta": {
    },
  • "data": [
    ]
}

Get programs associated with a form

What it does: Retrieves a list of all programs that have access to a specific form. In Apricot, forms can be shared across multiple programs, allowing different service areas to use the same data collection structure.

When to use it:

  • Discover which programs use a specific form
  • Verify form accessibility across programs
  • Understand form sharing and reuse patterns
  • Check if a form is available in a target program
  • Audit program-form associations
  • Plan program restructuring or consolidation

What you'll need:

  • Form ID (get from GET /apricot/forms)
  • Access token with apricot.read scope

What you'll get back: Array of program objects that have access to this form, each containing:

  • Program ID
  • Program name
  • Program active status
  • Program description
  • Program metadata

Common scenarios:

  • A "Client Intake" form shared across multiple service programs
  • An "Assessment" form used by different departments
  • Standard forms replicated across regional programs
  • Universal forms available to all programs

Use this to:

  • Determine if you need to associate a form with additional programs
  • Understand data collection scope across your organization
  • Identify forms that are widely shared vs. program-specific
  • Plan form assignments when creating new programs
Authorizations:
authorizer-lambdaapi_key
path Parameters
id
required
integer <int32>
header Parameters
Authorization
required
string

Header that carries token for request Authorization

Responses

Response Schema: application/vnd.api+json
Array of objects (ApricotProgram)

Array of program objects

Request samples

curl -X GET "https://api.bonterra.network/v1/apricot/forms/2/programs" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response samples

Content type
application/vnd.api+json
{
  • "data": [
    ]
}

Get user's accessible programs for a form

What it does: Retrieves the list of programs that the authenticated user has access to for a specific form. This helps determine which programs a user can create or view records in for the given form.

When to use it:

  • Build dynamic UI showing which programs a user can access for a form
  • Validate user permissions before creating records
  • Filter program dropdowns based on user access
  • Implement role-based access control in your application
  • Display personalized program lists

What you'll need:

  • Form ID
  • Access token (identifies the user automatically)

What you'll get back: Array of programs the authenticated user can access for this form.

Authorizations:
authorizer-lambdaapi_key
path Parameters
id
required
integer <int32>
header Parameters
Authorization
required
string

Header that carries token for request Authorization

Responses

Response Schema: application/vnd.api+json
Array of objects (ApricotProgram)

Array of program objects

Request samples

curl -X GET "https://api.bonterra.network/v1/apricot/forms/2/userPrograms" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Response samples

Content type
application/vnd.api+json
{
  • "data": [
    ]
}