# fyi.opensocial.importAccountSpace

> While an account's move here is pending (importAccount), bring one of its spaces, as its own server serves it: `meta`, a space it governs (com.atproto.space.exportSpaceMeta's archive), before any repo in it; `repo`, its own repo in a space it wrote in (com.atproto.space.getRepo's archive); or `blob`, one of its files in a space, before the repos that hold it. Only for whoever started the move, and only the account's own. A personalspace or memberspace policy is kept as this host's grants; one this host would not keep as it says is refused.

- Kind: procedure
- Authority: opensocial.fyi
- Lexicon: 1
- Published by [lexicons.opensocial.fyi](https://lexicon.garden/identity/did:plc:2gqnilpksz2e7faj3bwvo6qc), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:2gqnilpksz2e7faj3bwvo6qc/fyi.opensocial.importAccountSpace)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:2gqnilpksz2e7faj3bwvo6qc/fyi.opensocial.importAccountSpace/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:2gqnilpksz2e7faj3bwvo6qc/fyi.opensocial.importAccountSpace/analytics)

## Procedure (`fyi.opensocial.importAccountSpace`)

Type: procedure · POST

### Parameters (query string)

- `did` (string · did, required)
- `part` (string, required)
  - Constraints: knownValues: meta | repo | blob

### Input (*/*)


### Output (application/json)

- `cid` (string): A file's CID.
- `records` (integer): How many of a repo's records were kept: one this host would not keep, not of its collection's type, is left out.
- `space` (string): The space a meta archive or repo was for.

### Errors

- `NotFound`: No move of the account here by the caller, or a repo in a space of the account's whose meta has not come.
- `NotSpaceOwner`: A space or repo that is not the account's.
- `InvalidArchive`: An archive that is not whole, or not what its commit says.
- `UnsupportedPolicy`: A space whose policy this host would not keep as it says: anyone writing, only some apps, or a managing app.
- `SpaceReserved`: A space the group makes for itself as it is made.
- `TooLarge`: More than this host takes in one part.

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "While an account's move here is pending (importAccount), bring one of its spaces, as its own server serves it: `meta`, a space it governs (com.atproto.space.exportSpaceMeta's archive), before any repo in it; `repo`, its own repo in a space it wrote in (com.atproto.space.getRepo's archive); or `blob`, one of its files in a space, before the repos that hold it. Only for whoever started the move, and only the account's own. A personalspace or memberspace policy is kept as this host's grants; one this host would not keep as it says is refused.",
      "errors": [
        {
          "description": "No move of the account here by the caller, or a repo in a space of the account's whose meta has not come.",
          "name": "NotFound"
        },
        {
          "description": "A space or repo that is not the account's.",
          "name": "NotSpaceOwner"
        },
        {
          "description": "An archive that is not whole, or not what its commit says.",
          "name": "InvalidArchive"
        },
        {
          "description": "A space whose policy this host would not keep as it says: anyone writing, only some apps, or a managing app.",
          "name": "UnsupportedPolicy"
        },
        {
          "description": "A space the group makes for itself as it is made.",
          "name": "SpaceReserved"
        },
        {
          "description": "More than this host takes in one part.",
          "name": "TooLarge"
        }
      ],
      "input": {
        "encoding": "*/*"
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "cid": {
              "description": "A file's CID.",
              "type": "string"
            },
            "records": {
              "description": "How many of a repo's records were kept: one this host would not keep, not of its collection's type, is left out.",
              "type": "integer"
            },
            "space": {
              "description": "The space a meta archive or repo was for.",
              "type": "string"
            }
          },
          "type": "object"
        }
      },
      "parameters": {
        "properties": {
          "did": {
            "format": "did",
            "type": "string"
          },
          "part": {
            "knownValues": [
              "meta",
              "repo",
              "blob"
            ],
            "type": "string"
          }
        },
        "required": [
          "did",
          "part"
        ],
        "type": "params"
      },
      "type": "procedure"
    }
  },
  "id": "fyi.opensocial.importAccountSpace",
  "lexicon": 1
}
```
