---
updatedAt: 2026-06-26T23:36:44.000Z
agentTools:
  projectIndex: https://docs.smartsurvey.io/llms.txt
---

# Update

Update an existing API key by its id

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "SS Public API",
    "version": "v2"
  },
  "servers": [
    {
      "url": "https://{host}/v2",
      "description": "Select the host for the region your account's data is stored in.",
      "variables": {
        "host": {
          "default": "api.smartsurvey.io",
          "description": "The regional hostname for your account.",
          "enum": [
            "api.smartsurvey.io",
            "api-eu.smartsurvey.io",
            "api-us.smartsurvey.io"
          ]
        }
      }
    }
  ],
  "paths": {
    "/account/api-keys/{apiKeyId}": {
      "put": {
        "tags": [
          "ApiKeys"
        ],
        "summary": "Update",
        "description": "Update an existing API key by its id",
        "parameters": [
          {
            "name": "apiKeyId",
            "in": "path",
            "description": "The Api Key id that you want to update",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SmartSurvey.Public.API.Models.ApiKeys.ApiKeyUpdateModel"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SmartSurvey.Public.API.Models.ApiKeys.ApiKeyUpdateModel"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SmartSurvey.Public.API.Models.ApiKeys.ApiKeyUpdateModel"
              }
            },
            "application/xml": {
              "schema": {
                "$ref": "#/components/schemas/SmartSurvey.Public.API.Models.ApiKeys.ApiKeyUpdateModel"
              }
            },
            "text/xml": {
              "schema": {
                "$ref": "#/components/schemas/SmartSurvey.Public.API.Models.ApiKeys.ApiKeyUpdateModel"
              }
            },
            "application/*+xml": {
              "schema": {
                "$ref": "#/components/schemas/SmartSurvey.Public.API.Models.ApiKeys.ApiKeyUpdateModel"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SmartSurvey.Public.API.Models.ApiKeys.ApiKeyResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SmartSurvey.Public.API.Models.ApiKeys.ApiKeyResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SmartSurvey.Public.API.Models.ApiKeys.ApiKeyResponse"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/SmartSurvey.Public.API.Models.ApiKeys.ApiKeyResponse"
                }
              },
              "text/xml": {
                "schema": {
                  "$ref": "#/components/schemas/SmartSurvey.Public.API.Models.ApiKeys.ApiKeyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Request validation errors",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ValidationProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ValidationProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ValidationProblemDetails"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ValidationProblemDetails"
                }
              },
              "text/xml": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ValidationProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Api Key not found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              },
              "text/xml": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Microsoft.AspNetCore.Mvc.ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "A URI reference [RFC3986] that identifies the problem type. This specification encourages that, when\r\ndereferenced, it provide human-readable documentation for the problem type\r\n(e.g., using HTML [W3C.REC-html5-20141028]). When this member is not present, its value is assumed to be\r\n\"about:blank\".",
            "nullable": true
          },
          "title": {
            "type": "string",
            "description": "A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence\r\nof the problem, except for purposes of localization(e.g., using proactive content negotiation;\r\nsee[RFC7231], Section 3.4).",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "description": "The HTTP status code([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.",
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "description": "A human-readable explanation specific to this occurrence of the problem.",
            "nullable": true
          },
          "instance": {
            "type": "string",
            "description": "A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.",
            "nullable": true
          }
        },
        "additionalProperties": {},
        "description": "A machine-readable format for specifying errors in HTTP API responses based on <see href=\"https://tools.ietf.org/html/rfc7807\" />."
      },
      "Microsoft.AspNetCore.Mvc.ValidationProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "A URI reference [RFC3986] that identifies the problem type. This specification encourages that, when\r\ndereferenced, it provide human-readable documentation for the problem type\r\n(e.g., using HTML [W3C.REC-html5-20141028]). When this member is not present, its value is assumed to be\r\n\"about:blank\".",
            "nullable": true
          },
          "title": {
            "type": "string",
            "description": "A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence\r\nof the problem, except for purposes of localization(e.g., using proactive content negotiation;\r\nsee[RFC7231], Section 3.4).",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "description": "The HTTP status code([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.",
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "description": "A human-readable explanation specific to this occurrence of the problem.",
            "nullable": true
          },
          "instance": {
            "type": "string",
            "description": "A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.",
            "nullable": true
          },
          "errors": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "nullable": true
          }
        },
        "additionalProperties": {}
      },
      "SmartSurvey.Public.API.Models.ApiKeys.ApiKeyResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "The unique api key id",
            "format": "int32"
          },
          "member_id": {
            "type": "integer",
            "description": "Gets or sets the member id that owns the key (only set if it is a sub-user's key)",
            "format": "int32",
            "nullable": true
          },
          "name": {
            "type": "string",
            "description": "The display name for the API key",
            "nullable": true
          },
          "token": {
            "type": "string",
            "description": "The token/clientid for the api key",
            "nullable": true
          },
          "secret_key": {
            "type": "string",
            "description": "The secret for the api key",
            "nullable": true
          },
          "allowed_calls": {
            "type": "string",
            "description": "Which calls are allowed for this api key",
            "nullable": true
          },
          "total_requests": {
            "type": "integer",
            "description": "The total number of requests made with this key",
            "format": "int32"
          },
          "date_last_request": {
            "type": "string",
            "description": "Date that the last request was made or the added date if no requests have been made",
            "format": "date-time"
          },
          "active": {
            "type": "boolean",
            "description": "Whether this api key is active or not"
          }
        },
        "additionalProperties": false,
        "description": "An object containing the Api Key data for API calls"
      },
      "SmartSurvey.Public.API.Models.ApiKeys.ApiKeyUpdateModel": {
        "type": "object",
        "properties": {
          "name": {
            "maxLength": 250,
            "type": "string",
            "description": "The display name for the api key",
            "nullable": true
          },
          "allowed_calls": {
            "pattern": "(get|post|put|delete|admin)(,(get|post|put|delete))*",
            "type": "string",
            "description": "The allowed calls e.g. get, post etc.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A model for updating api key entries"
      }
    },
    "securitySchemes": {
      "Basic": {
        "type": "http",
        "description": "Basic Authorization",
        "scheme": "basic"
      }
    }
  },
  "security": [
    {
      "Basic": []
    }
  ]
}
```