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

# Create a Secret

Creates a new Secret to securely store a sensitive value.

## Body

## Returns

Returns the newly created Secret object. Note that the `value` field is not returned in the response.

```bash cURL theme={null}
curl https://production.methodfi.com/secrets \
  -X POST \
  -H "Method-Version: 2026-03-30" \
  -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc" \
  -H "Content-Type: application/json" \
  -d '{
    "value": "pk_1234567890",
    "metadata": {
      "environment": "production"
    }
  }'
```

```javascript Node.js theme={null}
const secret = await method.secrets.create({
  value: 'pk_1234567890',
  metadata: {
    environment: 'production'
  }
});
```

```python Python theme={null}
secret = method.secrets.create({
  'value': 'pk_1234567890',
  'metadata': {
    'environment': 'production'
  }
})
```

```json theme={null}
{
  "id": "sec_au22b1fbFrmfp",
  "metadata": {
    "environment": "production"
  },
  "created_at": "2025-12-04T18:50:54.024Z",
  "updated_at": "2025-12-04T18:50:54.024Z",
  "status": "active"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.