# Look into another account

`opensend imports inspect`

Counts what a key can read in a Resend account: domains, contacts, templates, webhooks and the rest, and says which of them an import brings over. It reads and changes nothing, there or here, and the key is not kept.

Needs the scope: `imports:write`

## Flags

- `--source` (string): The service to read the account from. Without it, `resend`. One of: `resend`.
- `--api-key` (string, required): A key of the other account with full access. At Resend it starts with `re_`. It is used to read, never to send or to change anything there.

## Returns

The command prints the answer: as JSON when its output goes to a file or another program, and as a table or a list of fields in a terminal. When the API refuses, the error goes to the error stream and the command ends with a code that names the failure. [Output and scripts](https://opensend.sh/docs/scripting) lists the codes.

- `object` ("import_inventory"): Always `import_inventory`.
- `source` (string): The service whose account was looked into: `resend`. One of: `resend`.
- `resources` (object[]): Everything the key can read there, with how much of it there is.
- `resources[].resource` (string): What was counted. One of: `domains`, `suppressions`, `audiences`, `contacts`, `templates`, `broadcasts`, `webhooks`, `api_keys`, `topics`, `contact_properties`, `automations`, `events`.
- `resources[].count` (integer): How many the first page holds, up to 100.
- `resources[].more` (boolean): Whether there are more than that.
- `resources[].importable` (boolean): Whether an import brings it over.
- `resources[].note` (string): What to know before bringing it over: why it stays behind when it does, or how it arrives. Empty when there is nothing to add.

## Example

CLI:

```bash
opensend imports inspect --api-key re_full_access_sample_key
```

Answer:

```json
{
  "object": "import_inventory",
  "source": "resend",
  "resources": [
    {
      "resource": "domains",
      "count": 3,
      "more": false,
      "importable": true,
      "note": "They arrive waiting for their DNS records, which are different here."
    },
    {
      "resource": "suppressions",
      "count": 3,
      "more": false,
      "importable": true,
      "note": ""
    },
    {
      "resource": "audiences",
      "count": 2,
      "more": false,
      "importable": true,
      "note": "Each segment becomes an audience with the same name."
    },
    {
      "resource": "contacts",
      "count": 5,
      "more": false,
      "importable": true,
      "note": "Each person comes over once, with their address, their names and whether they are subscribed, and joins the audience of every segment they are in."
    },
    {
      "resource": "templates",
      "count": 2,
      "more": false,
      "importable": true,
      "note": "They keep their alias, and the published ones arrive published."
    },
    {
      "resource": "broadcasts",
      "count": 2,
      "more": false,
      "importable": true,
      "note": "Only the drafts. Broadcasts that were sent or are queued stay at Resend."
    },
    {
      "resource": "webhooks",
      "count": 2,
      "more": false,
      "importable": true,
      "note": "Each endpoint keeps the signing secret it has, so the code that checks it does not change."
    },
    {
      "resource": "api_keys",
      "count": 2,
      "more": false,
      "importable": true,
      "note": "Only their names. A key cannot be read from Resend, so enroll the ones your programs hold."
    },
    {
      "resource": "topics",
      "count": 1,
      "more": false,
      "importable": true,
      "note": "The topics, then what each contact chose. That part takes one request for each contact, about four a second."
    },
    {
      "resource": "contact_properties",
      "count": 1,
      "more": false,
      "importable": true,
      "note": "The properties with their types and fallbacks, then what each contact holds. That part takes one request for each contact, about four a second."
    },
    {
      "resource": "automations",
      "count": 1,
      "more": false,
      "importable": false,
      "note": "Automations are not brought over yet. Build them again here: nothing of theirs runs twice."
    },
    {
      "resource": "events",
      "count": 1,
      "more": false,
      "importable": false,
      "note": "Events are not brought over yet. Define them again here when you build the automations."
    }
  ]
}
```
