Skip to main content
POST
/
api
/
contracts
Create a contract
curl --request POST \
  --url https://admin.snagsolutions.io/api/contracts \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '
{
  "name": "<string>",
  "address": "0x1234567890abcdef1234567890abcdef12345678",
  "chainId": 123,
  "organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "websiteId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "abi": null
}
'
{
  "id": "123e4567-e89b-12d3-a456-426614174003",
  "name": "My Contract",
  "address": "0xabc123...",
  "chainId": 1,
  "type": "ERC721",
  "organizationId": "123e4567-e89b-12d3-a456-426614174002",
  "abi": "[{ \"constant\": true, ... }]"
}

Documentation Index

Fetch the complete documentation index at: https://docs.snagsolutions.io/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

X-API-KEY
string
header
required

Body

application/json

Body

name
string
required
Maximum string length: 40
address
string
required

The address of the contract

Example:

"0x1234567890abcdef1234567890abcdef12345678"

chainId
number | null
required
type
enum<string>
required
Available options:
erc20,
erc721,
erc1155,
custom
organizationId
string<uuid>
required
websiteId
string<uuid>
required
abi
unknown

Response

201

Schema for a contract

id
string<uuid>
required

Unique identifier for the contract

Example:

"123e4567-e89b-12d3-a456-426614174003"

name
string | null
required

Name of the contract

Maximum string length: 40
Example:

"My Contract"

address
string
required

Contract address matching the required format

Pattern: ^0x[a-fA-F0-9]{40}$
Example:

"0xabc123..."

chainId
integer<int64>
required

ID of the blockchain chain

Example:

1

type
enum<string>
required

Type of the contract

Available options:
erc20,
erc721,
erc1155,
custom
Example:

"ERC721"

organizationId
string<uuid>
required

Unique identifier for the organization

Example:

"123e4567-e89b-12d3-a456-426614174002"

abi
any | null

Application Binary Interface of the contract

Example:

"[{ \"constant\": true, ... }]"