# For Devs

## Create your OWN API based template

Intract's team offers enterprises the ability to create, test, and use their own customised API templates.

***

### Getting started with API:

> <mark style="color:orange;">This section is intended for technical individuals.</mark>

#### Summary:

To create a custom API verification task, Intract requires an API developed according by our standards. When a quester interacts with this task, Intract will call the API with the required parameters and check if the task is verified.

This API will first be verified by Intract’s development team to check if all the standards are met

#### Keys Supported:

When we connect with your projects API for verification we will send some keys in payload body. We support the following keys for verification:

1. Address

   User’s wallet address.\
   🚨 We support EVM compatible addresses and NON EVM addresses (Solana, Keplr, Ton and Starknet).
2. Twitter ID

   User account ID of user’s Twitter account.
3. TwitterHandle\
   User's Twitter account handle.
4. Discord ID\
   User account ID of user’s Discord account.
5. Discord

   Discord user name of user’s discord account.
6. Telegram

   User ID of user’s telegram account.
7. Email

   User’s email address.

You can also add constants not already mentioned above

#### API Signature

* The API can be a POST or GET request.
* URL format:

  ```jsx
  https://<domain>/<serverpath>
  ```

  > ✅NOTE: We only support https requests.
* Payload

  The API should support payload with this format.

  ```jsx
  {
  	"address": "user's evm address in lowercase",
  	"twitter": "twitter account ID",
  	"discord": "Discord username",
  	"telegram": "Telegram user ID",
  	"email":    "email address"
  }
  ```

  > ✅NOTE: We will only include keys in the payload that are defined in the task template. For example, if the task template only mentions "address" as input, then only the "address" key will be present in the payload.

  When the task is **recurring** in nature two additional keys will be sent along with the above mentioned details. The following keys will be sent: startTimestamp and endTimestamp which are the start and end brackets of when the task is being verified.

  Example payload in this case:

  ```jsx
  {
  	"address": "user's evm address in lowercase",
  	"startTimestamp":"2024-03-20T00:00:00.000Z",
  	"endTimestamp":"2024-03-20T23:59:59.000Z"
  }
  ```
* Headers

  We will send security headers if mentioned.

#### Response Structure

We require the API response structure in a defined format. Failure to return data in this format will result in automatic rejection of the API approval.

**Format**:

```jsx
{
    "error": {
        "code": 0,
        "message": "error message"
     },
     "data": { // required, whether success or error
         "result": <true | false> // bool, the user has done the task.
     }
}
```

**Status Code:**

The API should always return status code 200.

#### Performance Requirements

Intract’s campaigns receive a lot of scale. We require that APIs fulfils all performance requirements

These are some of the performance requirements needed for us to verify your API for usage.

* Uptime: The API should meet 99.5% uptime SLA.
* Throughput: The API should be able to handle a minimum of 50 req/sec.
* Response Time: The API should have an average response time on less than 3 seconds. The max response time allowed is 5 seconds. We timeout the verification calls after 5 seconds.
* Error Rate: The average error rate in an hour should be less than 0.5 percent.

  > If in runtime the error rate increases more than the mentioned limit we disable the verification task all together.

✅ All these performance requirements will be tested by load testing before approval.

#### Note: Once the API is created please visit [here](https://app.intract.io/app/tools/task-apis) to integrate.


---

# 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.intract.io/product-guide/tools-guides/integrate-apis/for-devs.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.
