# API Endpoints

This page documents the Salesforce Bot Integration API. Endpoints are configured per deployment, so the values below use placeholders — substitute the values provided for your org.

## Authentication

Every request requires two things:

* The `org` query parameter — your Salesforce Org ID.
* An `X-API-Key` header carrying the API key issued for your deployment.

Keys are issued per org and must be kept secret and sent over HTTPS. A request with a missing or incorrect key returns:

```json
{ "code": 401, "status": "Unauthorized" }
```

## Conventions

* **Base URL:** `https://realintelligence.com/customers/api/`
* **Confirm (read) calls** are `GET` requests to `api.php`.
* **Create (write) calls** are `POST` requests to `api_create.php`.
* Every call includes `org=YOUR_ORG_ID` and the `X-API-Key` header.

Placeholders used below:

| Placeholder                                                             | Replace with                           |
| ----------------------------------------------------------------------- | -------------------------------------- |
| `YOUR_ORG_ID`                                                           | Your Salesforce Org ID                 |
| `YOUR_API_KEY`                                                          | The API key issued for your deployment |
| `{email}`                                                               | A contact email address                |
| `{phone}`                                                               | A contact phone number                 |
| `{contact_id}`, `{account_id}`, `{event_id}`                            | Salesforce record IDs                  |
| `{account_name}`, `{subject}`, `{issue}`, `{first_name}`, `{last_name}` | Free-text values                       |

## Confirm (lookup) endpoints

`GET` to `api.php`. Verify that a record exists before continuing a conversation.

| Action                  | Parameters                          | Looks up                                 |
| ----------------------- | ----------------------------------- | ---------------------------------------- |
| `Confirm_Contact`       | `email`                             | A contact by email                       |
| `Confirm_Contact_Phone` | `phone`                             | A contact by phone                       |
| `Confirm_Case`          | `email`                             | Cases for a contact email                |
| `Confirm_Registration`  | `email`                             | Event registrations for an email         |
| `Confirm_Speaker`       | `contactID`, `eventID` *(optional)* | A speaker, optionally scoped to an event |
| `Confirm_Exhibitor`     | `contactID`                         | An exhibitor by contact                  |
| `Confirm_Account`       | `accountName`                       | An account by name                       |

Example:

```
GET https://realintelligence.com/customers/api/api.php?action=Confirm_Contact&email={email}&org=YOUR_ORG_ID
X-API-Key: YOUR_API_KEY
```

A successful confirm returns:

```json
{ "code": 200, "status": "Success", "msg": [ ... ] }
```

## Create endpoints

`POST` to `api_create.php`. Send the parameters as POST fields and the key as a header.

| Action           | Required      | Optional                          |
| ---------------- | ------------- | --------------------------------- |
| `Create_Account` | `accountName` | —                                 |
| `Create_Contact` | `lastName`    | `firstName`, `email`, `AccountID` |
| `Create_Case`    | `Subject`     | `Issue`, `ContactID`, `AccountID` |

Example:

```
POST https://realintelligence.com/customers/api/api_create.php
X-API-Key: YOUR_API_KEY
Content-Type: application/x-www-form-urlencoded

action=Create_Contact&lastName={last_name}&firstName={first_name}&email={email}&org=YOUR_ORG_ID
```

A successful create returns the new record ID:

```json
{ "code": 200, "status": "Contact Created Successfully", "id": "{contact_id}" }
```

## Notes

* These operations map to the capabilities on [Supported Functions](/bot-integration-voice-and-chat/bot-integration-functions.md).
* Endpoint hostnames and field mappings can vary per deployment; use the values provided for your org.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.realintelligence.com/bot-integration-voice-and-chat/bot-integration-endpoints.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
