---
title: "corestack_company_magento_keys_update"
url: https://docs.corefinity.com/mcp/tools/corestack_company_magento_keys_update
type: tool
last_updated: 2026-11-13
feature: magento
related:
  - https://docs.corefinity.com/api/reference/organisation/update-company-magento-keys.md
  - https://docs.corefinity.com/guides/platforms/magento-2.md
---
# corestack_company_magento_keys_update

**Set the Magento repository keys.** Set your company's own repo.magento.com access keys, used by its Magento 2 sites to install packages. They are checked with repo.magento.com before they are saved. Omit both to have the person add them in the control panel. For a client company your agency manages, send client_company_id. Scope: write.

- Scope: `write`
- Runs as a task: no

## When to use it

Set your company's own repo.magento.com access keys, used by its Magento 2 sites to install packages. They are checked with repo.magento.com before they are saved. For a client company your agency manages, send `client_company_id`.

When your agency sets a client company's keys, the client company's owners are emailed which agency and which person added or replaced them, and when; never a key. The answer's `updated_by.agency` names your agency.

## Inputs

- `public_key` (string, pattern `^[a-f0-9]{32}$`, required; optional while `app_versions` is on): 32 characters: 0–9 and a–f.
- `private_key` (string, pattern `^[a-f0-9]{32}$`, required; optional while `app_versions` is on): 32 characters: 0–9 and a–f. While `app_versions` is on, leave both keys out to have the person add them in the Control Panel (Company settings, Magento Marketplace keys): the call asks for the page to be opened and answers the saved keys on the retry; one key without the other is `invalid_arguments`.
- `client_company_id` (integer, at least 1): A client company your agency manages, by id. Omit for your own company.

### Input schema

```json
{
  "additionalProperties": false,
  "properties": {
    "client_company_id": {
      "description": "A client company your agency manages, by id. Omit for your own company.",
      "minimum": 1,
      "type": "integer"
    },
    "private_key": {
      "description": "32 characters: 0–9 and a–f.",
      "pattern": "^[a-f0-9]{32}$",
      "type": "string"
    },
    "public_key": {
      "description": "32 characters: 0–9 and a–f.",
      "pattern": "^[a-f0-9]{32}$",
      "type": "string"
    }
  },
  "type": "object"
}
```

## Refusals

- `upstream_unavailable`: the Control Panel answered 502: the cluster, a DNS resolver, Cloudflare, Mailgun, a Git provider, Google, Xero or Cloud Storage did not answer; `details.upstream` names it; retry later.
- `tenant_mismatch` (with `client_company_id`): the company is not one your agency manages, or it does not exist; the same answer for both. Being attached to your agency is not enough: one of its live CoreStack sites must name your agency as its managing agency.
- `pin_refused` (with `client_company_id`): a token limited to some sites cannot act on a client company's keys.
- `invalid_arguments` (with `client_company_id` and neither key, while the organisation pages are off): give both keys. Without the organisation pages, the Control Panel has no page where the person could add a client company's keys.
- The refusals every tool can answer: `invalid_arguments`, `tenant_mismatch`, `scope_required`, `pin_refused`, `rate_limited`, `temporarily_unavailable`, `internal_error` (corestack://guides/how-this-server-works).

## Example

```json
{
  "name": "corestack_company_magento_keys_update",
  "arguments": {
    "public_key": "0123456789abcdef0123456789abcdef",
    "private_key": "fedcba9876543210fedcba9876543210"
  }
}
```

## Prompt

```text
Using the Corefinity MCP server, call corestack_company_magento_keys_update with public_key 0123456789abcdef0123456789abcdef, private_key fedcba9876543210fedcba9876543210. (Set the Magento repository keys.) Tell me what it returned.
```

## The same task elsewhere

- Endpoint: [PUT /api/companies/{company}/magento-keys](https://docs.corefinity.com/api/reference/organisation/update-company-magento-keys.md)
- Guide: [Magento 2](https://docs.corefinity.com/guides/platforms/magento-2.md)
