---
title: Pin Thing
description: Pin Thing metadata to IPFS
url: https://docs.intuition.systems/docs/v1/graphql-api/mutations/pin-thing
markdown_url: https://docs.intuition.systems/docs/v1/graphql-api/mutations/pin-thing.md
version: V1
llms_index: https://docs.intuition.systems/docs/v1/llms.txt
---

Pin a "Thing" object (general entity) to IPFS for use in atom creation.

## Endpoint and Auth

Use the public gated pinning endpoint and send your Intuition pin API key in an `apikey` header:

```text
https://pin.intuition.systems/v1/graphql
```

Keep the key in a trusted server runtime. Do not pass it in the URL or expose it in public browser environment variables.

Create an authenticated client before sending the mutation:

```typescript
import { GraphQLClient } from 'graphql-request';
import { PIN_API_URL } from '@0xintuition/graphql';

const client = new GraphQLClient(PIN_API_URL, {
  headers: {
    apikey: process.env.INTUITION_PIN_API_KEY!,
  },
});
```

## Mutation Structure

```graphql
mutation PinThing($thing: PinThingInput!) {
  pinThing(thing: $thing) {
    uri
  }
}
```

## Variables

```json
{
  "thing": {
    "name": "TypeScript Programming Language",
    "description": "A strongly typed programming language that builds on JavaScript",
    "image": "ipfs://QmXnnyufdzAWL5CqZ2RnSNgPbvCc1ALT73s6epPrRnZ1Xy",
    "url": "https://www.typescriptlang.org"
  }
}
```

## Response

```json
{
  "data": {
    "pinThing": {
      "uri": "ipfs://QmYx8C3kNN1sFSx5b..."
    }
  }
}
```

## Workflow

1. **Pin metadata** using `pinThing` mutation
2. **Get IPFS URI** from response
3. **Create atom on-chain** using the URI
4. **Query the atom** via GraphQL API

## Best Practices

1. **Upload images first** if needed using `uploadImage`
2. **Include all metadata** fields for rich display
3. **Store IPFS URI** for future reference
4. **Wait for indexing** before querying the atom
