> ## Documentation Index
> Fetch the complete documentation index at: https://docs.neuro-tech.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Sign contract

> Allows the client to sign a smart contract.
Note: Neurons are federated.

## Overview

Allows the client to sign a smart contract.

Note: Neurons are federated. You can sign contracts created on other neurons through this API on the neuron you have your account on. Federated means that the neurons interconnect to share authorized information, when requested, and permitted.

## HTTP request

`POST /Agent/Legal/SignContract`

## Authentication

Requires a valid JWT bearer token.

## Request (JSON)

```json theme={null}
{
	"keyId": Required(Str(PKeyId)),
	"legalId": Required(Str(PLegalId)),
	"contractId": Required(Str(PContractId)),
	"role": Required(Str(PRole)),
	"nonce": Required(Str(PNonce)),
	"keySignature": Required(Str(PKeySignature)),
	"requestSignature": Required(Str(PRequestSignature))
}
```

## Input parameters

| Parameter         | Description                                                                                                                                                             |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| PKeyId            | Identity of key to use for signing the contract. It must correspond to the key used when signing the Legal Identity application that will be used to sign the contract. |
| PContractId       | ID of smart contract to sign.                                                                                                                                           |
| PLegalId          | Identity of the Legal Identity that will be used to sign the smart contract.                                                                                            |
| Role              | For what role the signature will be made.                                                                                                                               |
| PNonce            | A unique random string, at least 32 characters long, with sufficient entropy to not be reused again. If reused, an error will be returned.                              |
| PKeySignature     | Cryptographic signature of the key ID, using the key password.                                                                                                          |
| PRequestSignature | Cryptographic signature of the requesut, using the account password.                                                                                                    |

## Response (JSON)

```json theme={null}
{
	"Contract": Required(PContract)
}
```

## Response parameters

| Parameter | Description                                       |
| --------- | ------------------------------------------------- |
| PContract | Updated Smart Contract object with the signature. |

## Notes

This endpoint uses the request schema notation described in [Pattern matching](/guides/pattern-matching).
