Kotini - Partner API (0.0.3)

Download OpenAPI specification:Download

Introduction

Welcome to the Kotini Partners API documentation!

This API is designed to provide seamless integration with the Kotini platform, allowing our partners to access and manage data related to Case, Customer and Property.

This API follows RESTful principles and utilizes JSON for all request and response payloads, making it easy to integrate into your existing systems. It uses secure OAuth 2.0 authentication to ensure data integrity and privacy.

The documentation will guide you through all aspects of the Kotini Partners API, including authentication, request structures, endpoints, and best practices. Whether you're building an app or integrating Kotini data into your platform, this API will provide the tools you need for smooth operations.

Authentication

OAuth 2.0

This API uses OAuth 2.0 for authentication, supporting two flows:

  1. Direct Access Grants (Resource Owner Password Credentials)
  2. Standard Authorization Code Flow

Both methods provide secure access to the Partner API. The choice between them depends on your specific use case and security requirements.

Common Endpoints

Test Environment

  • Token URL: https://auth.kotini.co/realms/partner/protocol/openid-connect/token
  • Authorization URL: https://auth.kotini.co/realms/partner/protocol/openid-connect/auth

Production Environment

  • Token URL: https://auth.kotini.co.uk/realms/partner/protocol/openid-connect/token
  • Authorization URL: https://auth.kotini.co.uk/realms/partner/protocol/openid-connect/auth

1. Direct Access Grants Flow

This method is suitable for trusted applications that can securely handle user credentials.

Authentication Steps

  1. Request Access Token: Send a POST request to the token URL with the required parameters.
  2. Receive Access Token: Upon successful authentication, you'll receive an access token.
  3. Access the API: Include the access token in the Authorization header of your requests.

Required Parameters

Include the following parameters in the request body:

  • grant_type: Set this to password
  • client_id: Your assigned client ID
  • username: The user's email address
  • password: The user's password

Example Request

POST /realms/partner/protocol/openid-connect/token HTTP/1.1
Host: auth.kotini.co
Content-Type: application/x-www-form-urlencoded

grant_type=password&client_id=your_client_id&username=user@example.com&password=user_password

2. Standard Authorization Code Flow

This method is ideal for web applications and provides a more secure authentication process.

Authentication Steps

  1. Authorization Request: Redirect the user to the authorization URL.
  2. User Authentication: The user logs in and grants permission to your application.
  3. Authorization Code: Receive an authorization code.
  4. Token Request: Exchange the authorization code for an access token.
  5. Access the API: Use the access token to make API requests.

Authorization Request Parameters

  • response_type: Set this to code
  • client_id: Your assigned client ID
  • redirect_uri: Your application's callback URL
  • scope: Requested permissions (e.g., openid profile email)
  • state: A unique string to prevent CSRF attacks

Example Authorization Request

https://auth.kotini.co/realms/partner/protocol/openid-connect/auth?
response_type=code&
client_id=your_client_id&
redirect_uri=https://your-app.com/callback&
scope=openid profile email&
state=random_state_string

Token Request

After receiving the authorization code, exchange it for an access token:

POST /realms/partner/protocol/openid-connect/token HTTP/1.1
Host: auth.kotini.co
Content-Type: application/x-www-form-urlencoded

grant_type=authorization_code&
client_id=your_client_id&
client_secret=your_client_secret&
code=received_authorization_code&
redirect_uri=https://your-app.com/callback

Using the Access Token

Once you've obtained the access token (via either method), include it in the Authorization header of your API requests:

GET /api/v1/cases HTTP/1.1
Host: partner.service.kotini.co.uk
Authorization: Bearer <access_token>

Security Considerations

  • Always use HTTPS for all API interactions.
  • Store client IDs, secrets, and user credentials securely.
  • Never expose sensitive information in client-side code.
  • Implement proper error handling for authentication failures.
  • For the Authorization Code flow, validate the state parameter to prevent CSRF attacks.
  • Consider implementing token refresh mechanisms for long-lived sessions.

Remember to replace placeholder values (like your_client_id, etc.) with your actual values when implementing the authentication flows.

Webhook

Webhook operations

Subscribe

Subscribe to a webhook

Request Body schema: application/json
required

Payload containing the details of the webhook subscription

webhook_id
required
string <uuid>

The unique identifier of the webhook

name
required
string [ 1 .. 255 ] characters

The name of the webhook

status
required
string
Enum: "active" "inactive"

The current status of the webhook

last_success
string or null <date-time>

The timestamp of the last successful delivery of the webhook

failure_count
required
integer >= 0

The number of consecutive failed deliveries

Responses

Request samples

Content type
application/json
{
  • "webhook_id": "e9e1f1d0-1b6b-4f3b-8eab-6f6f6f6f6f6f",
  • "name": "CRM Webhook",
  • "status": "active",
  • "last_success": "2021-01-01T00:00:00Z",
  • "failure_count": 4
}

Response samples

Content type
application/json
{
  • "webhook_id": "e9e1f1d0-1b6b-4f3b-8eab-6f6f6f6f6f6f",
  • "name": "CRM Webhook",
  • "status": "active",
  • "last_success": "2021-01-01T00:00:00Z",
  • "failure_count": 0
}

Get Webhooks

Get all webhooks

Authorizations:
oauth2

Responses

Unsubscribe

Unsubscribe from a webhook

Authorizations:
oauth2
path Parameters
webhook_id
required
string <uuid>
Example: e9e1f1d0-1b6b-4f3b-8eab-6f6f6f6f6f6f

The ID of the webhook that needs to be unsubscribed

Responses

Case

Case operations

Case Event Webhook

This endpoint is triggered when a case event happenns.

Request Body schema: application/json
required

Payload containing the details of the event and case

version
required
string

The version of event system used.

idempotency_key
required
string

A unique key to ensure idempotency.

type
required
string
Enum: "sale.created" "sale.onboarding" "sale.onboarded" "purchase.created" "purchase.onboarding" "purchase.onboarded" "transaction.connected"

The type of event.

required
object (Case)

Responses

Request samples

Content type
application/json
{
  • "version": "string",
  • "idempotency_key": "string",
  • "type": "sale.created",
  • "data": {
    }
}

Get Case

Get case by ID

Authorizations:
oauth2
path Parameters
case_id
required
string

The ID of the case that needs to be fetched

Responses

Response samples

Content type
application/json
{
  • "case_id": "e9e1f1d0-1b6b-4f3b-8eab-6f6f6f6f6f6f",
  • "type": "sale",
  • "status": "onboarded",
  • "tags": [
    ],
  • "sale_terms": {
    },
  • "property": {
    },
  • "disclosures": [
    ],
  • "viewing_preference": {
    },
  • "marketing": {
    },
  • "participants": [
    ]
}

Update Case Status

Update case status by ID

path Parameters
case_id
required
string

The ID of the case that needs to be fetched

Request Body schema: application/json
required

Payload containing the details of the status update

status
required
string
Value: "onboarded"

The status of the case

Responses

Request samples

Content type
application/json
{
  • "status": "onboarded"
}

Response samples

Content type
application/json
{
  • "case_id": "e9e1f1d0-1b6b-4f3b-8eab-6f6f6f6f6f6f",
  • "type": "sale",
  • "status": "onboarded",
  • "tags": [
    ],
  • "sale_terms": {
    },
  • "property": {
    },
  • "disclosures": [
    ],
  • "viewing_preference": {
    },
  • "marketing": {
    },
  • "participants": [
    ]
}

Update Requirement

Connect a transaction to a case

path Parameters
case_id
required
string <uuid>

The ID of the case that needs to be fetched

Request Body schema: application/json
required

Payload containing the transaction ID

requirement
required
string

The name of the requirement to update

state
string

The state of the requirement

Responses

Request samples

Content type
application/json
{
  • "requirement": "string",
  • "state": "string"
}

Response samples

Content type
application/json
{
  • "case_id": "e9e1f1d0-1b6b-4f3b-8eab-6f6f6f6f6f6f",
  • "type": "sale",
  • "status": "onboarded",
  • "tags": [
    ],
  • "sale_terms": {
    },
  • "property": {
    },
  • "disclosures": [
    ],
  • "viewing_preference": {
    },
  • "marketing": {
    },
  • "participants": [
    ]
}

Connect Transaction

Connect a transaction to a case

path Parameters
case_id
required
string <uuid>

The ID of the case that needs to be fetched

Request Body schema: application/json
required

Payload containing the transaction ID

transaction_id
required
string <uuid>

The ID of the transaction to connect

Responses

Request samples

Content type
application/json
{
  • "transaction_id": "0fec1e58-b197-4052-99cf-2218496c5482"
}

Response samples

Content type
application/json
{
  • "case_id": "e9e1f1d0-1b6b-4f3b-8eab-6f6f6f6f6f6f",
  • "type": "sale",
  • "status": "onboarded",
  • "tags": [
    ],
  • "sale_terms": {
    },
  • "property": {
    },
  • "disclosures": [
    ],
  • "viewing_preference": {
    },
  • "marketing": {
    },
  • "participants": [
    ]
}

Add Sale Terms

Add sale terms to a case

path Parameters
case_id
required
string <uuid>

The ID of the case that needs to be fetched

Request Body schema: application/json
required

Payload containing the transaction ID

sale_terms_id
string <uuid>

The ID of the sale terms

status
required
string
Enum: "created" "accepted"

The status of the sale terms

fee_type
required
string
Value: "Free text"

The fee type of the case

agency_type
string
Enum: "Sole Agency" "Sole Selling Rights" "Multiple Agency" "Joint Agency"

The type of agency term for the case

agency_term
required
integer

The length of the agency term in weeks

vat
required
boolean

Whether VAT is applicable to the case

initial_marketing_price
required
number <float>

The initial marketing price of the case

initial_marketing_price_qualifier
required
string
Enum: "Asking price" "Guide price" "Offers over" "Offers in the region of" "Fixed Price"

The qualifier for the initial marketing price

fee_description
required
string

The fee description of the case

start_date
string <date>

The start date of the sale terms

special_conditions
string

The special conditions of the sale terms

cancellation_email
string <email>

The email address for cancellations

cancellation_address
string

The address for cancellations

withdrawal_fee
number <float>

The withdrawal fee for the case

Responses

Request samples

Content type
application/json
{
  • "sale_terms_id": "e9e1f1d0-1b6b-4f3b-8eab-6f6f6f6f6f6f",
  • "status": "accepted",
  • "fee_type": "Free text",
  • "agency_type": "Sole Agency",
  • "agency_term": 12,
  • "vat": true,
  • "initial_marketing_price": 100000,
  • "initial_marketing_price_qualifier": "Asking price",
  • "fee_description": "1% plus VAT",
  • "start_date": "2022-01-01",
  • "special_conditions": "Special conditions",
  • "cancellation_email": "user@example.com",
  • "cancellation_address": "string",
  • "withdrawal_fee": 1000
}

Response samples

Content type
application/json
{
  • "case_id": "e9e1f1d0-1b6b-4f3b-8eab-6f6f6f6f6f6f",
  • "type": "sale",
  • "status": "onboarded",
  • "tags": [
    ],
  • "sale_terms": {
    },
  • "property": {
    },
  • "disclosures": [
    ],
  • "viewing_preference": {
    },
  • "marketing": {
    },
  • "participants": [
    ]
}

Update Sale Terms

Update sale terms to a case

path Parameters
case_id
required
string <uuid>

The ID of the case that needs to be fetched

Request Body schema: application/json
required

Payload containing the transaction ID

sale_terms_id
string <uuid>

The ID of the sale terms

status
required
string
Enum: "created" "accepted"

The status of the sale terms

fee_type
required
string
Value: "Free text"

The fee type of the case

agency_type
string
Enum: "Sole Agency" "Sole Selling Rights" "Multiple Agency" "Joint Agency"

The type of agency term for the case

agency_term
required
integer

The length of the agency term in weeks

vat
required
boolean

Whether VAT is applicable to the case

initial_marketing_price
required
number <float>

The initial marketing price of the case

initial_marketing_price_qualifier
required
string
Enum: "Asking price" "Guide price" "Offers over" "Offers in the region of" "Fixed Price"

The qualifier for the initial marketing price

fee_description
required
string

The fee description of the case

start_date
string <date>

The start date of the sale terms

special_conditions
string

The special conditions of the sale terms

cancellation_email
string <email>

The email address for cancellations

cancellation_address
string

The address for cancellations

withdrawal_fee
number <float>

The withdrawal fee for the case

Responses

Request samples

Content type
application/json
{
  • "sale_terms_id": "e9e1f1d0-1b6b-4f3b-8eab-6f6f6f6f6f6f",
  • "status": "accepted",
  • "fee_type": "Free text",
  • "agency_type": "Sole Agency",
  • "agency_term": 12,
  • "vat": true,
  • "initial_marketing_price": 100000,
  • "initial_marketing_price_qualifier": "Asking price",
  • "fee_description": "1% plus VAT",
  • "start_date": "2022-01-01",
  • "special_conditions": "Special conditions",
  • "cancellation_email": "user@example.com",
  • "cancellation_address": "string",
  • "withdrawal_fee": 1000
}

Response samples

Content type
application/json
{
  • "case_id": "e9e1f1d0-1b6b-4f3b-8eab-6f6f6f6f6f6f",
  • "type": "sale",
  • "status": "onboarded",
  • "tags": [
    ],
  • "sale_terms": {
    },
  • "property": {
    },
  • "disclosures": [
    ],
  • "viewing_preference": {
    },
  • "marketing": {
    },
  • "participants": [
    ]
}

Create Case

Create a new case

Request Body schema: application/json
required

Payload containing the details of the status update

type
required
string
Enum: "sale" "purchase"

The type of the case

object (CaseProperty)

The property of the case

Array of objects (CaseParticipant)

The participants of the case

Array of objects (CaseAssignee)

The assignees of the case

Responses

Request samples

Content type
application/json
{
  • "type": "sale",
  • "property": {
    },
  • "participants": [
    ],
  • "assignees": [
    ]
}

Response samples

Content type
application/json
{
  • "case_id": "e9e1f1d0-1b6b-4f3b-8eab-6f6f6f6f6f6f",
  • "type": "sale",
  • "status": "onboarded",
  • "tags": [
    ],
  • "sale_terms": {
    },
  • "property": {
    },
  • "disclosures": [
    ],
  • "viewing_preference": {
    },
  • "marketing": {
    },
  • "participants": [
    ]
}

Add Disclosures

Add disclosures to a case

path Parameters
case_id
required
string <uuid>

The ID of the case that needs to be fetched

Request Body schema: application/json
required

Payload containing the transaction ID

Array
case_disclosure_id
required
string <uuid>

The ID of the case disclosure

created
string <date-time>

The date the case disclosure was created

type
required
string

The type of the case disclosure

detail
string

The details of the case disclosure

first_name
required
string

The first name of the user

last_name
required
string

The last name of the user

email
required
string

The email of the user

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
{
  • "case_id": "e9e1f1d0-1b6b-4f3b-8eab-6f6f6f6f6f6f",
  • "type": "sale",
  • "status": "onboarded",
  • "tags": [
    ],
  • "sale_terms": {
    },
  • "property": {
    },
  • "disclosures": [
    ],
  • "viewing_preference": {
    },
  • "marketing": {
    },
  • "participants": [
    ]
}

Case / Property

Property operations

Get Property

Get case by ID

Authorizations:
oauth2
path Parameters
case_id
required
string

The ID of the case that needs to be fetched

Responses