# About

This API interfaces asynchronously with Cryptosat's satellites and ground testbeds known as "FlatSats". It enables queuing commands that are later sent within the operational time slots throughout the 24h time period.&#x20;

## Tutorial

The following is an example of how to store, sign with and delete a private key.

### Authentication

Make sure you provide an[ API in the header](https://docs.cryptosat.io/cryptosat/api-documentation/authentication).

### Store a Private Key

Send the following body to:

**POST** `{{api-url}}/frost/private_key`

with the following body:

```json
{
    "key_id" : "mXJQWAAq4L5DQ9zaEQJfqL3VNBmL6osKa0umzpYfTec=",
    "private_key" : "hdi/CAih7GbtA2uhFI0b+6xyy9vHeotaT6oonDNueD8Dh3eTrT1Ky5UFCyadOCbzSQreZEDoqc1zXQ3yf8OvwXgC9vi4uZqhbvHayYLck8NoB64SYXlYbKjgxgULeKWk2Lg="
}
```

You should get the following similar response:

```json
{
    "statusCode": 200,
    "body": {
        "request": {
            "request_uuid": "c6f9c441-446d-4d07-bc11-1b5d868bb942",
            "request_name": "private_key",
            "request_verb": "POST",
            "request_status": {
                "status_code": 0,
                "status_name": "PENDING"
            },
            "response_eta": "2022-12-30 14:21:14",
            "created_at": "2022-12-30 10:21:14",
            "satellite_id": "crypto1"
        }
    }
}
```

Note that the `status_name` is [`PENDING`](https://docs.cryptosat.io/cryptosat/api-documentation/queue-api/api-reference/queue). This is because the command has not yet been sent to the satellite and is queued for the next visibility window indicated by `response_eta`.

You can check the status by using the `request_uuid` obtained from the store command to check if it has been sent off:

**GET** `{{api-url}}/queue/request?=request_id=c6f9c441-446d-4d07-bc11-1b5d868bb942`

You should get the following response:

```json
{
    "request": {
        "request_uuid": "c6f9c441-446d-4d07-bc11-1b5d868bb942",
        "request_name": "private_key",
        "request_verb": "POST",
        "request_status": {
            "request_status": "PENDING",
            "status_code": "0"
        },
        "created_at": "2022-12-30 10:21:14",
        "response_eta": "2022-12-30 14:21:14",
        "satellite_id": "crypto1"
    },
    "response_payload": {}
}
```

When the command has changed to `SENT`, it can no longer be deleted. Once it is READY, the `response_payload` will be populated and the command can be archived.

The other commands function in a smilar way.
