# Flow Version Variables

## Create Flow Version Variable

> Creates a new variable for a flow version. Requires a \`type\` and \`key\`, and optionally accepts a \`value\`, \`date\_format\`, and \`secret\` flag.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Flow Version Variables"}],"servers":[{"url":"https://core.wearepatchworks.com"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"API key passed in the Authorization header. Format: `<api-key>`"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth 2 Bearer token obtained from POST /fabric/api/login"}},"schemas":{"VariablesResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Variables"}}},"Variables":{"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier"},"label":{"type":"string"},"key":{"type":"string"},"value":{"type":"string"},"secret":{"type":"string"},"locked":{"type":"string"},"configurable":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"modified":{"type":"string"},"pivot":{"type":"string"},"required":{"type":"boolean"},"advanced":{"type":"boolean"},"alias":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"message":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}},"FlowVersionsStoreVariablesRequest":{"type":"object","properties":{"type":{"type":"string"},"key":{"type":"string","minLength":1},"value":{"type":"string","maximum":1024},"date_format":{"type":"string","nullable":true},"secret":{"type":"string"}},"required":["key","type"]}}},"paths":{"/api/v1/flow-versions/{flow_version}/variables":{"post":{"summary":"Create Flow Version Variable","description":"Creates a new variable for a flow version. Requires a `type` and `key`, and optionally accepts a `value`, `date_format`, and `secret` flag.","parameters":[{"name":"flow_version","in":"path","required":true,"schema":{"type":"string"},"description":"The flow version identifier."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VariablesResponse"}}}},"401":{"description":"Unauthenticated"},"403":{"description":"Unauthorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowVersionsStoreVariablesRequest"}}}},"tags":["Flow Version Variables"]}}}}
```

## Update Flow Version Variable

> Updates an existing flow version variable. Accepts \`type\`, \`key\`, \`value\`, \`date\_format\`, and \`secret\` flag.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Flow Version Variables"}],"servers":[{"url":"https://core.wearepatchworks.com"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"API key passed in the Authorization header. Format: `<api-key>`"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth 2 Bearer token obtained from POST /fabric/api/login"}},"schemas":{"VariablesResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Variables"}}},"Variables":{"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier"},"label":{"type":"string"},"key":{"type":"string"},"value":{"type":"string"},"secret":{"type":"string"},"locked":{"type":"string"},"configurable":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"modified":{"type":"string"},"pivot":{"type":"string"},"required":{"type":"boolean"},"advanced":{"type":"boolean"},"alias":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"message":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}},"FlowVersionsUpdateVariablesRequest":{"type":"object","properties":{"type":{"type":"string"},"key":{"type":"string","minLength":1},"value":{"type":"string","maximum":1024},"date_format":{"type":"string","nullable":true},"secret":{"type":"string"}},"required":["key","type"]}}},"paths":{"/api/v1/flow-versions/{flow_version}/variables/{variable}":{"put":{"summary":"Update Flow Version Variable","description":"Updates an existing flow version variable. Accepts `type`, `key`, `value`, `date_format`, and `secret` flag.","parameters":[{"name":"flow_version","in":"path","required":true,"schema":{"type":"string"},"description":"The flow version identifier."},{"name":"variable","in":"path","required":true,"schema":{"type":"string"},"description":"The variable identifier."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VariablesResponse"}}}},"401":{"description":"Unauthenticated"},"403":{"description":"Unauthorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowVersionsUpdateVariablesRequest"}}}},"tags":["Flow Version Variables"]}}}}
```

## Delete Flow Version Variable

> Permanently deletes a specific flow version variable.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Flow Version Variables"}],"servers":[{"url":"https://core.wearepatchworks.com"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"API key passed in the Authorization header. Format: `<api-key>`"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth 2 Bearer token obtained from POST /fabric/api/login"}},"schemas":{"MessageResponse":{"type":"object","properties":{"message":{"type":"string"}}}}},"paths":{"/api/v1/flow-versions/{flow_version}/variables/{variable}":{"delete":{"summary":"Delete Flow Version Variable","description":"Permanently deletes a specific flow version variable.","parameters":[{"name":"flow_version","in":"path","required":true,"schema":{"type":"string"},"description":"The flow version identifier."},{"name":"variable","in":"path","required":true,"schema":{"type":"string"},"description":"The variable identifier."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"401":{"description":"Unauthenticated"},"403":{"description":"Unauthorized"}},"tags":["Flow Version Variables"]}}}}
```
