> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://tc.docs.syndicate.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://tc.docs.syndicate.io/_mcp/server.

# Authorize Contract with JSON ABI

POST https://api.syndicate.io/admin/contract/authorizeWithJSONABI
Content-Type: application/json

Authorize a contract and its corresponding function signatures using the JSON ABI format.

Reference: https://tc.docs.syndicate.io/api/admin/contracts-function-signatures/authorize-contract-with-jsonabi

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Body (application/json)

This endpoint expects an AuthorizeContractWithJSONABIRequest.

- `abi` (list of any, required)
- `address` (string, required)
- `chainId` (integer, required)
- `name` (string, required)
- `projectId` (UUID, required)
- `expiresAt` (datetime, optional)

## Response

### 200

- `address` (string, required)
- `chainId` (integer, required)
- `createdAt` (datetime, required)
- `functionSignatures` (list of FunctionSignature, required)
- `id` (string, required)
- `name` (string, required)
- `projectId` (UUID, required)
- `claimedByOrganizationId` (UUID, optional)
- `expiresAt` (datetime, optional)
- `updatedAt` (datetime, optional)

## Errors

### 400 Status Bad Request

### 404 Status Not Found

### 409 Status Conflict

### 500 Status Internal Server Error

## Types

### FunctionSignature

- `contractId` (UUID, required)
- `createdAt` (datetime, required)
- `hashedSignature` (string, required)
- `id` (string, required)
- `payable` (boolean, required)
- `signature` (string, required)
- `functionAbi` (any, optional) — JSON ABI of the function signature. Null if function signature is unable to be parsed.
- `updatedAt` (datetime, optional)

## Examples

**Request**

```json
{
  "abi": [
    {
      "type": "function",
      "name": "addPerson",
      "constant": false,
      "payable": false,
      "inputs": [
        {
          "type": "tuple",
          "name": "person",
          "components": [
            {
              "type": "string",
              "name": "name"
            },
            {
              "type": "uint16",
              "name": "age"
            }
          ]
        }
      ],
      "outputs": []
    }
  ],
  "address": "0x94f6E9c420Db1566A3c035Df291F206eBfAfC762",
  "chainId": 80001,
  "name": "My Contract",
  "projectId": "638d1d78-d63d-4cda-9f1e-4d0799acfeee"
}
```

**Response**

```json
{
  "address": "0x94f6E9c420Db1566A3c035Df291F206eBfAfC762",
  "chainId": 80001,
  "createdAt": "2023-10-25T13:00:49.667604Z",
  "functionSignatures": [
    {
      "contractId": "70c2891a-6471-4b50-844b-6a58b69ff8fb",
      "createdAt": "2023-10-25T13:00:49.667604Z",
      "hashedSignature": "0x1234",
      "id": "4416002f-6b79-4c24-b367-80572c37f35a",
      "payable": false,
      "signature": "addPerson((string name, uint16 age) person))",
      "functionAbi": {
        "type": "function",
        "name": "addPerson",
        "inputs": [
          {
            "name": "person",
            "type": "tuple",
            "components": [
              {
                "name": "name",
                "type": "string"
              },
              {
                "name": "age",
                "type": "uint16"
              }
            ]
          }
        ],
        "stateMutability": "nonpayable"
      }
    }
  ],
  "id": "70c2891a-6471-4b50-844b-6a58b69ff8fb",
  "name": "My Contract",
  "projectId": "638d1d78-d63d-4cda-9f1e-4d0799acfeee",
  "updatedAt": "2023-10-25T13:00:49.667604Z"
}
```

**SDK Code**

```python
import requests

url = "https://api.syndicate.io/admin/contract/authorizeWithJSONABI"

payload = {
    "abi": [
        {
            "type": "function",
            "name": "addPerson",
            "constant": False,
            "payable": False,
            "inputs": [
                {
                    "type": "tuple",
                    "name": "person",
                    "components": [
                        {
                            "type": "string",
                            "name": "name"
                        },
                        {
                            "type": "uint16",
                            "name": "age"
                        }
                    ]
                }
            ],
            "outputs": []
        }
    ],
    "address": "0x94f6E9c420Db1566A3c035Df291F206eBfAfC762",
    "chainId": 80001,
    "name": "My Contract",
    "projectId": "638d1d78-d63d-4cda-9f1e-4d0799acfeee"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.syndicate.io/admin/contract/authorizeWithJSONABI';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"abi":[{"type":"function","name":"addPerson","constant":false,"payable":false,"inputs":[{"type":"tuple","name":"person","components":[{"type":"string","name":"name"},{"type":"uint16","name":"age"}]}],"outputs":[]}],"address":"0x94f6E9c420Db1566A3c035Df291F206eBfAfC762","chainId":80001,"name":"My Contract","projectId":"638d1d78-d63d-4cda-9f1e-4d0799acfeee"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.syndicate.io/admin/contract/authorizeWithJSONABI"

	payload := strings.NewReader("{\n  \"abi\": [\n    {\n      \"type\": \"function\",\n      \"name\": \"addPerson\",\n      \"constant\": false,\n      \"payable\": false,\n      \"inputs\": [\n        {\n          \"type\": \"tuple\",\n          \"name\": \"person\",\n          \"components\": [\n            {\n              \"type\": \"string\",\n              \"name\": \"name\"\n            },\n            {\n              \"type\": \"uint16\",\n              \"name\": \"age\"\n            }\n          ]\n        }\n      ],\n      \"outputs\": []\n    }\n  ],\n  \"address\": \"0x94f6E9c420Db1566A3c035Df291F206eBfAfC762\",\n  \"chainId\": 80001,\n  \"name\": \"My Contract\",\n  \"projectId\": \"638d1d78-d63d-4cda-9f1e-4d0799acfeee\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.syndicate.io/admin/contract/authorizeWithJSONABI")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"abi\": [\n    {\n      \"type\": \"function\",\n      \"name\": \"addPerson\",\n      \"constant\": false,\n      \"payable\": false,\n      \"inputs\": [\n        {\n          \"type\": \"tuple\",\n          \"name\": \"person\",\n          \"components\": [\n            {\n              \"type\": \"string\",\n              \"name\": \"name\"\n            },\n            {\n              \"type\": \"uint16\",\n              \"name\": \"age\"\n            }\n          ]\n        }\n      ],\n      \"outputs\": []\n    }\n  ],\n  \"address\": \"0x94f6E9c420Db1566A3c035Df291F206eBfAfC762\",\n  \"chainId\": 80001,\n  \"name\": \"My Contract\",\n  \"projectId\": \"638d1d78-d63d-4cda-9f1e-4d0799acfeee\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.syndicate.io/admin/contract/authorizeWithJSONABI")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"abi\": [\n    {\n      \"type\": \"function\",\n      \"name\": \"addPerson\",\n      \"constant\": false,\n      \"payable\": false,\n      \"inputs\": [\n        {\n          \"type\": \"tuple\",\n          \"name\": \"person\",\n          \"components\": [\n            {\n              \"type\": \"string\",\n              \"name\": \"name\"\n            },\n            {\n              \"type\": \"uint16\",\n              \"name\": \"age\"\n            }\n          ]\n        }\n      ],\n      \"outputs\": []\n    }\n  ],\n  \"address\": \"0x94f6E9c420Db1566A3c035Df291F206eBfAfC762\",\n  \"chainId\": 80001,\n  \"name\": \"My Contract\",\n  \"projectId\": \"638d1d78-d63d-4cda-9f1e-4d0799acfeee\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.syndicate.io/admin/contract/authorizeWithJSONABI', [
  'body' => '{
  "abi": [
    {
      "type": "function",
      "name": "addPerson",
      "constant": false,
      "payable": false,
      "inputs": [
        {
          "type": "tuple",
          "name": "person",
          "components": [
            {
              "type": "string",
              "name": "name"
            },
            {
              "type": "uint16",
              "name": "age"
            }
          ]
        }
      ],
      "outputs": []
    }
  ],
  "address": "0x94f6E9c420Db1566A3c035Df291F206eBfAfC762",
  "chainId": 80001,
  "name": "My Contract",
  "projectId": "638d1d78-d63d-4cda-9f1e-4d0799acfeee"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.syndicate.io/admin/contract/authorizeWithJSONABI");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"abi\": [\n    {\n      \"type\": \"function\",\n      \"name\": \"addPerson\",\n      \"constant\": false,\n      \"payable\": false,\n      \"inputs\": [\n        {\n          \"type\": \"tuple\",\n          \"name\": \"person\",\n          \"components\": [\n            {\n              \"type\": \"string\",\n              \"name\": \"name\"\n            },\n            {\n              \"type\": \"uint16\",\n              \"name\": \"age\"\n            }\n          ]\n        }\n      ],\n      \"outputs\": []\n    }\n  ],\n  \"address\": \"0x94f6E9c420Db1566A3c035Df291F206eBfAfC762\",\n  \"chainId\": 80001,\n  \"name\": \"My Contract\",\n  \"projectId\": \"638d1d78-d63d-4cda-9f1e-4d0799acfeee\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "abi": [
    [
      "type": "function",
      "name": "addPerson",
      "constant": false,
      "payable": false,
      "inputs": [
        [
          "type": "tuple",
          "name": "person",
          "components": [
            [
              "type": "string",
              "name": "name"
            ],
            [
              "type": "uint16",
              "name": "age"
            ]
          ]
        ]
      ],
      "outputs": []
    ]
  ],
  "address": "0x94f6E9c420Db1566A3c035Df291F206eBfAfC762",
  "chainId": 80001,
  "name": "My Contract",
  "projectId": "638d1d78-d63d-4cda-9f1e-4d0799acfeee"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.syndicate.io/admin/contract/authorizeWithJSONABI")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```